Module technology.sola.engine
Record Class Padding
java.lang.Object
java.lang.Record
technology.sola.engine.graphics.gui.style.property.Padding
- Record Components:
top
- the top padding for the elementleft
- the left padding for the elementbottom
- the bottom padding for the elementright
- the right padding for the element
- All Implemented Interfaces:
MergeableProperty<Padding>
@NullMarked
public record Padding(@Nullable Integer top, @Nullable Integer right, @Nullable Integer bottom, @Nullable Integer left)
extends Record
implements MergeableProperty<Padding>
Padding contains the properties for a
GuiElement
's padding which is the
space between the element's border and content.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPadding()
Creates a new Padding instance with no values set.Creates a new Padding instance with all values set to the same.Creates a new Padding instance with vertical and horizontal values set.Creates a new Padding instance with top, horizontal, and bottom values set.Padding
(@Nullable Integer top, @Nullable Integer right, @Nullable Integer bottom, @Nullable Integer left) Creates an instance of aPadding
record class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Integer
bottom()
Returns the value of thebottom
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
Padding with all values set to 0.
-
-
Constructor Details
-
Padding
public Padding()Creates a new Padding instance with no values set. -
Padding
Creates a new Padding instance with top, horizontal, and bottom values set.- Parameters:
top
- the top padding for the elementleftAndRight
- the left and right padding for the elementbottom
- the bottom padding for the element
-
Padding
Creates a new Padding instance with vertical and horizontal values set.- Parameters:
topAndBottom
- the top and bottom padding for the elementleftAndRight
- the left and right padding for the element
-
Padding
Creates a new Padding instance with all values set to the same.- Parameters:
size
- the value for each side of the padding
-
Padding
public Padding(@Nullable Integer top, @Nullable Integer right, @Nullable Integer bottom, @Nullable Integer left) Creates an instance of aPadding
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<Padding>
- 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)
. -
top
Returns the value of thetop
record component.- Returns:
- the value of the
top
record component
-
right
Returns the value of theright
record component.- Returns:
- the value of the
right
record component
-
bottom
Returns the value of thebottom
record component.- Returns:
- the value of the
bottom
record component
-
left
Returns the value of theleft
record component.- Returns:
- the value of the
left
record component
-