Module technology.sola.engine
Record Class Border
java.lang.Object
java.lang.Record
technology.sola.engine.graphics.gui.style.property.Border
- Record Components:
color- theColorof 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 Integerbottom()Returns the value of thebottomrecord component.@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.@Nullable Integerleft()Returns the value of theleftrecord component.Returns a new instance of the property with the resulting values being a merge of the right on top of the left.@Nullable Integerright()Returns the value of therightrecord component.@Nullable Integertop()Returns the value of thetoprecord component.final StringtoString()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- theColorof the border
-
Border
public Border(@Nullable Color color, @Nullable Integer top, @Nullable Integer left, @Nullable Integer bottom, @Nullable Integer right) Creates an instance of aBorderrecord class.
-
-
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<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 thecolorrecord component.- Returns:
- the value of the
colorrecord component
-
top
Returns the value of thetoprecord component.- Returns:
- the value of the
toprecord component
-
left
Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
bottom
Returns the value of thebottomrecord component.- Returns:
- the value of the
bottomrecord component
-
right
Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-