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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSample data related to movies.static enumRepresents a movie genre.static interfaceRepresents a function that accepts oneMovieargument and produces a result.static final recordRepresents a "member" record.static classImplementations ofComparable<Movie>that impose various orderings. -
Constructor Summary
ConstructorsConstructorDescriptionMovie(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 aMovierecord class. -
Method Summary
Modifier and TypeMethodDescriptioncast()Returns the value of thecastrecord component.Returns the value of thedirectorsrecord component.final booleanIndicates whether some other object is "equal to" this one.genres()Returns the value of thegenresrecord component.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.intrating()Returns the value of theratingrecord component.runtime()Returns the value of theruntimerecord component.tagline()Returns the value of thetaglinerecord component.final StringtoString()Returns a string representation of this record class.writers()Returns the value of thewritersrecord component.year()Returns the value of theyearrecord component.
-
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 aMovierecord class.- Parameters:
name- the value for thenamerecord componentyear- the value for theyearrecord componentrating- the value for theratingrecord componentgenres- the value for thegenresrecord componentruntime- the value for theruntimerecord componenttagline- the value for thetaglinerecord componentcast- the value for thecastrecord componentdirectors- the value for thedirectorsrecord componentwriters- the value for thewritersrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
year
Returns the value of theyearrecord component.- Returns:
- the value of the
yearrecord component
-
rating
public int rating()Returns the value of theratingrecord component.- Returns:
- the value of the
ratingrecord component
-
genres
Returns the value of thegenresrecord component.- Returns:
- the value of the
genresrecord component
-
runtime
Returns the value of theruntimerecord component.- Returns:
- the value of the
runtimerecord component
-
tagline
Returns the value of thetaglinerecord component.- Returns:
- the value of the
taglinerecord component
-
cast
Returns the value of thecastrecord component.- Returns:
- the value of the
castrecord component
-
directors
Returns the value of thedirectorsrecord component.- Returns:
- the value of the
directorsrecord component
-
writers
Returns the value of thewritersrecord component.- Returns:
- the value of the
writersrecord component
-