Class Media

java.lang.Object
ch.bztf.m226blb1.Database.Entities.Media

@Entity public class Media extends Object
Entity for managing the media.
See Also:
  • Constructor Details

    • Media

      protected Media()
      Default constructor. Used by JPA.
    • Media

      public Media(MediaType type, @NotBlank @NotBlank String url)
      Constructor for creating a new media.
      Parameters:
      type - The type of the media.
      url - The url of the media.
  • Method Details

    • setUrl

      public void setUrl(String url)
      Sets the url of the media.
      Parameters:
      url - the new url
      See Also:
    • setPost

      public void setPost(@NonNull @NonNull Post post)
      Sets the post of the media. Will also remove from the old post and add to the new one.
      Parameters:
      post - the new post
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object