java.lang.Object
java.lang.Record
technology.sola.engine.graphics.gui.style.property.Background
Record Components:
color - the Color 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

    Constructors
    Constructor
    Description
    Background(@Nullable Color color)
    Creates an instance of a Background record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Color
    Returns the value of the color record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    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
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Background

      public Background(@Nullable Color color)
      Creates an instance of a Background record class.
      Parameters:
      color - the value for the color record component
  • Method Details

    • mergeWith

      public Background mergeWith(@Nullable Background otherProperty)
      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 interface MergeableProperty<Background>
      Parameters:
      otherProperty - the other property object to merge values on top of this one
      Returns:
      a new instance with the merged properties
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • color

      public @Nullable Color color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component