Module technology.sola.engine
Record Class Background
java.lang.Object
java.lang.Record
technology.sola.engine.graphics.gui.style.property.Background
- Record Components:
color- theColorof 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 aBackgroundrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Colorcolor()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()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 StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Background
Creates an instance of aBackgroundrecord class.- Parameters:
color- the value for thecolorrecord component
-
-
Method Details
-
mergeWith
Description copied from interface:MergeablePropertyReturns a new instance of the property with the resulting values being a merge of the right on top of the left.- Specified by:
mergeWithin 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 thecolorrecord component.- Returns:
- the value of the
colorrecord component
-