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 class
Sample data related to movies.static enum
Represents a movie genre.static interface
Represents a function that accepts oneMovie
argument and produces a result.static final record
Represents a "member" record.static class
Implementations 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 aMovie
record class. -
Method Summary
Modifier and TypeMethodDescriptioncast()
Returns the value of thecast
record component.Returns the value of thedirectors
record component.final boolean
Indicates whether some other object is "equal to" this one.genres()
Returns the value of thegenres
record component.final int
hashCode()
Returns a hash code value for this object.name()
Returns the value of thename
record component.int
rating()
Returns the value of therating
record component.runtime()
Returns the value of theruntime
record component.tagline()
Returns the value of thetagline
record component.final String
toString()
Returns a string representation of this record class.writers()
Returns the value of thewriters
record component.year()
Returns the value of theyear
record 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 aMovie
record class.- Parameters:
name
- the value for thename
record componentyear
- the value for theyear
record componentrating
- the value for therating
record componentgenres
- the value for thegenres
record componentruntime
- the value for theruntime
record componenttagline
- the value for thetagline
record componentcast
- the value for thecast
record componentdirectors
- the value for thedirectors
record componentwriters
- the value for thewriters
record 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 thename
record component.- Returns:
- the value of the
name
record component
-
year
Returns the value of theyear
record component.- Returns:
- the value of the
year
record component
-
rating
public int rating()Returns the value of therating
record component.- Returns:
- the value of the
rating
record component
-
genres
Returns the value of thegenres
record component.- Returns:
- the value of the
genres
record component
-
runtime
Returns the value of theruntime
record component.- Returns:
- the value of the
runtime
record component
-
tagline
Returns the value of thetagline
record component.- Returns:
- the value of the
tagline
record component
-
cast
Returns the value of thecast
record component.- Returns:
- the value of the
cast
record component
-
directors
Returns the value of thedirectors
record component.- Returns:
- the value of the
directors
record component
-
writers
Returns the value of thewriters
record component.- Returns:
- the value of the
writers
record component
-