Package de.malkusch.broadlinkBulb
Record Class Color
java.lang.Object
java.lang.Record
de.malkusch.broadlinkBulb.Color
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic final record -
Constructor Summary
ConstructorsConstructorDescriptionColor(int red, int green, int blue) Color(Color.Red red, Color.Green green, Color.Blue blue) Creates an instance of aColorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionblue()Returns the value of thebluerecord component.final booleanIndicates whether some other object is "equal to" this one.green()Returns the value of thegreenrecord component.final inthashCode()Returns a hash code value for this object.red()Returns the value of theredrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Color
public Color(int red, int green, int blue) -
Color
Creates an instance of aColorrecord class.- Parameters:
red- the value for theredrecord componentgreen- the value for thegreenrecord componentblue- the value for thebluerecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
red
Returns the value of theredrecord component.- Returns:
- the value of the
redrecord component
-
green
Returns the value of thegreenrecord component.- Returns:
- the value of the
greenrecord component
-
blue
Returns the value of thebluerecord component.- Returns:
- the value of the
bluerecord component
-