java.lang.Object
java.lang.Record
cs1302.oracle.model.Movie.Member
- Enclosing class:
- Movie
Represents a "member" record. The objects of this class can describe the
cast members,
directors, and
writers for a movie.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.name()
Returns the value of thename
record component.static Set<Movie.Member>
toMemberSet
(String... names) Returns an unmodifiable set of members with the supplied names.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Member
Creates an instance of aMember
record class.- Parameters:
name
- the value for thename
record component
-
-
Method Details
-
toMemberSet
Returns an unmodifiable set of members with the supplied names. This method ignores both leading and trailing whitespace.- Parameters:
names
- the names of the members- Returns:
- an unmodifiable set of members with the specified names
- Throws:
NullPointerException
- ifnames
or one of its elements isnull
- See Also:
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-