java.lang.Object
java.lang.Record
technology.sola.engine.graphics.gui.style.property.Border
Record Components:
color - the Color of the border
top - the width of the top part of the border
left - the width of the left part of the border
bottom - the width of the bottom part of the border
right - the width of the right part of the border
All Implemented Interfaces:
MergeableProperty<Border>

@NullMarked public record Border(@Nullable Color color, @Nullable Integer top, @Nullable Integer left, @Nullable Integer bottom, @Nullable Integer right) extends Record implements MergeableProperty<Border>
Border contains the properties for a GuiElement's border.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Border
    Border with 0 width.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Border(int size, Color color)
    Creates a border with all sides the same size.
    Border(@Nullable Color color, @Nullable Integer top, @Nullable Integer left, @Nullable Integer bottom, @Nullable Integer right)
    Creates an instance of a Border record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Integer
    Returns the value of the bottom record component.
    @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.
    @Nullable Integer
    Returns the value of the left record component.
    mergeWith(@Nullable Border otherProperty)
    Returns a new instance of the property with the resulting values being a merge of the right on top of the left.
    @Nullable Integer
    Returns the value of the right record component.
    @Nullable Integer
    top()
    Returns the value of the top record component.
    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
  • Field Details

    • NONE

      public static final Border NONE
      Border with 0 width.
  • Constructor Details

    • Border

      public Border(int size, Color color)
      Creates a border with all sides the same size.
      Parameters:
      size - the size of the border on all sides
      color - the Color of the border
    • Border

      public Border(@Nullable Color color, @Nullable Integer top, @Nullable Integer left, @Nullable Integer bottom, @Nullable Integer right)
      Creates an instance of a Border record class.
      Parameters:
      color - the value for the color record component
      top - the value for the top record component
      left - the value for the left record component
      bottom - the value for the bottom record component
      right - the value for the right record component
  • Method Details

    • mergeWith

      public Border mergeWith(@Nullable Border 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<Border>
      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
    • top

      public @Nullable Integer top()
      Returns the value of the top record component.
      Returns:
      the value of the top record component
    • left

      public @Nullable Integer left()
      Returns the value of the left record component.
      Returns:
      the value of the left record component
    • bottom

      public @Nullable Integer bottom()
      Returns the value of the bottom record component.
      Returns:
      the value of the bottom record component
    • right

      public @Nullable Integer right()
      Returns the value of the right record component.
      Returns:
      the value of the right record component