Record Class PackedColor
java.lang.Object
java.lang.Record
net.mezzdev.config.api.value.color.PackedColor
- Record Components:
packedValue- packed0xRRGGBBor0xAARRGGBBvalueformat- format of the packed value
A color stored as a packed integer.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionPackedColor(int packedValue, ConfigColorFormat format) Validate and create a packed color. -
Method Summary
Modifier and TypeMethodDescriptionstatic PackedColorargb(int packedValue) Create an ARGB color stored as0xAARRGGBB.final booleanIndicates whether some other object is "equal to" this one.format()Returns the value of theformatrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of thepackedValuerecord component.static PackedColorrgb(int packedValue) Create an RGB color stored as0xRRGGBB.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PackedColor
Validate and create a packed color.- Since:
- 0.1.0
-
-
Method Details
-
rgb
Create an RGB color stored as0xRRGGBB.- Parameters:
packedValue- packed RGB value- Returns:
- the packed color
- Since:
- 0.1.0
-
argb
Create an ARGB color stored as0xAARRGGBB.- Parameters:
packedValue- packed ARGB value- Returns:
- the packed color
- Since:
- 0.1.0
-
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 '=='. -
packedValue
public int packedValue()Returns the value of thepackedValuerecord component.- Returns:
- the value of the
packedValuerecord component
-
format
Returns the value of theformatrecord component.- Returns:
- the value of the
formatrecord component
-