Module technology.sola.engine
Record Class Background
java.lang.Object
java.lang.Record
technology.sola.engine.graphics.gui.style.property.Background
- Record Components:
color
- theColor
of the element's background
- All Implemented Interfaces:
MergeableProperty<Background>
@NullMarked
public record Background(@Nullable Color color)
extends Record
implements MergeableProperty<Background>
Background contains the properties for a
GuiElement
's background.-
Constructor Summary
ConstructorsConstructorDescriptionBackground
(@Nullable Color color) Creates an instance of aBackground
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Color
color()
Returns the value of thecolor
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.mergeWith
(@Nullable Background otherProperty) Returns a new instance of the property with the resulting values being a merge of the right on top of the left.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Background
Creates an instance of aBackground
record class.- Parameters:
color
- the value for thecolor
record component
-
-
Method Details
-
mergeWith
Description copied from interface:MergeableProperty
Returns a new instance of the property with the resulting values being a merge of the right on top of the left.- Specified by:
mergeWith
in interfaceMergeableProperty<Background>
- Parameters:
otherProperty
- the other property object to merge values on top of this one- Returns:
- a new instance with the merged properties
-
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)
. -
color
Returns the value of thecolor
record component.- Returns:
- the value of the
color
record component
-