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 aPaddingrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Integerbottom()Returns the value of thebottomrecord 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
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 aPaddingrecord 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<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 thetoprecord component.- Returns:
- the value of the
toprecord component
-
right
Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-
bottom
Returns the value of thebottomrecord component.- Returns:
- the value of the
bottomrecord component
-
left
Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-