Package ca.corbett.extras.gradient
Record Class Gradient
java.lang.Object
java.lang.Record
ca.corbett.extras.gradient.Gradient
-
Constructor Summary
ConstructorsConstructorDescriptionGradient(GradientType type, Color color1, Color color2) Creates an instance of aGradientrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolor1()Returns the value of thecolor1record component.color2()Returns the value of thecolor2record component.static Gradientfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Gradient
Creates an instance of aGradientrecord class.- Parameters:
type- the value for thetyperecord componentcolor1- the value for thecolor1record componentcolor2- the value for thecolor2record component
-
-
Method Details
-
createDefault
-
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
color1
Returns the value of thecolor1record component.- Returns:
- the value of the
color1record component
-
color2
Returns the value of thecolor2record component.- Returns:
- the value of the
color2record component
-