Record Class Movie

java.lang.Object
java.lang.Record
cs1302.oracle.model.Movie
All Implemented Interfaces:
Serializable

public record Movie(String name, Year year, int rating, List<Movie.Genre> genres, Duration runtime, String tagline, Set<Movie.Member> cast, Set<Movie.Member> directors, Set<Movie.Member> writers) extends Record implements Serializable
Represents a "movie" record.
See Also:
  • Constructor Details

    • Movie

      public Movie(String name, Year year, int rating, List<Movie.Genre> genres, Duration runtime, String tagline, Set<Movie.Member> cast, Set<Movie.Member> directors, Set<Movie.Member> writers)
      Creates an instance of a Movie record class.
      Parameters:
      name - the value for the name record component
      year - the value for the year record component
      rating - the value for the rating record component
      genres - the value for the genres record component
      runtime - the value for the runtime record component
      tagline - the value for the tagline record component
      cast - the value for the cast record component
      directors - the value for the directors record component
      writers - the value for the writers record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • year

      public Year year()
      Returns the value of the year record component.
      Returns:
      the value of the year record component
    • rating

      public int rating()
      Returns the value of the rating record component.
      Returns:
      the value of the rating record component
    • genres

      public List<Movie.Genre> genres()
      Returns the value of the genres record component.
      Returns:
      the value of the genres record component
    • runtime

      public Duration runtime()
      Returns the value of the runtime record component.
      Returns:
      the value of the runtime record component
    • tagline

      public String tagline()
      Returns the value of the tagline record component.
      Returns:
      the value of the tagline record component
    • cast

      public Set<Movie.Member> cast()
      Returns the value of the cast record component.
      Returns:
      the value of the cast record component
    • directors

      public Set<Movie.Member> directors()
      Returns the value of the directors record component.
      Returns:
      the value of the directors record component
    • writers

      public Set<Movie.Member> writers()
      Returns the value of the writers record component.
      Returns:
      the value of the writers record component