Module technology.sola.engine
Record Class Border
java.lang.Object
java.lang.Record
technology.sola.engine.graphics.gui.style.property.Border
- Record Components:
color
- theColor
of the bordertop
- the width of the top part of the borderleft
- the width of the left part of the borderbottom
- the width of the bottom part of the borderright
- 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Integer
bottom()
Returns the value of thebottom
record component.@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.@Nullable Integer
left()
Returns the value of theleft
record component.Returns a new instance of the property with the resulting values being a merge of the right on top of the left.@Nullable Integer
right()
Returns the value of theright
record component.@Nullable Integer
top()
Returns the value of thetop
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
NONE
Border with 0 width.
-
-
Constructor Details
-
Border
Creates a border with all sides the same size.- Parameters:
size
- the size of the border on all sidescolor
- theColor
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 aBorder
record class.
-
-
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<Border>
- 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
-
top
Returns the value of thetop
record component.- Returns:
- the value of the
top
record component
-
left
Returns the value of theleft
record component.- Returns:
- the value of the
left
record component
-
bottom
Returns the value of thebottom
record component.- Returns:
- the value of the
bottom
record component
-
right
Returns the value of theright
record component.- Returns:
- the value of the
right
record component
-