Record Class Sidebar.NumberFormat
java.lang.Object
java.lang.Record
net.minestom.server.scoreboard.Sidebar.NumberFormat
- All Implemented Interfaces:
ComponentHolder<Sidebar.NumberFormat>
- Enclosing class:
Sidebar
public static record Sidebar.NumberFormat(net.minestom.server.scoreboard.Sidebar.NumberFormat.FormatType formatType, @Nullable Component content)
extends Record
implements ComponentHolder<Sidebar.NumberFormat>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNumberFormat(net.minestom.server.scoreboard.Sidebar.NumberFormat.FormatType formatType, @Nullable Component content) Creates an instance of aNumberFormatrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Sidebar.NumberFormatblank()A number format which has no sidebar score displayedGets the components held by this object.content()Returns the value of thecontentrecord component.copyWithOperator(UnaryOperator<Component> operator) Returns a copy of this object.final booleanIndicates whether some other object is "equal to" this one.static Sidebar.NumberFormatA number format which lets the sidebar scores be styled with explicit textnet.minestom.server.scoreboard.Sidebar.NumberFormat.FormatTypeReturns the value of theformatTyperecord component.final inthashCode()Returns a hash code value for this object.static Sidebar.NumberFormatA number format which lets the sidebar scores be styledfinal StringtoString()Returns a string representation of this record class.Methods inherited from interface ComponentHolder
visitComponents
-
Field Details
-
SERIALIZER
-
-
Constructor Details
-
NumberFormat
public NumberFormat(net.minestom.server.scoreboard.Sidebar.NumberFormat.FormatType formatType, @Nullable @Nullable Component content) Creates an instance of aNumberFormatrecord class.- Parameters:
formatType- the value for theformatTyperecord componentcontent- the value for thecontentrecord component
-
-
Method Details
-
blank
A number format which has no sidebar score displayed- Returns:
- a blank number format
-
styled
A number format which lets the sidebar scores be styled- Parameters:
style- a styled component
-
fixed
A number format which lets the sidebar scores be styled with explicit text- Parameters:
content- the fixed component
-
components
Description copied from interface:ComponentHolderGets the components held by this object.- Specified by:
componentsin interfaceComponentHolder<Sidebar.NumberFormat>- Returns:
- the components
-
copyWithOperator
Description copied from interface:ComponentHolderReturns a copy of this object. For each component this object holds, the operator is applied to the copy before returning.- Specified by:
copyWithOperatorin interfaceComponentHolder<Sidebar.NumberFormat>- Parameters:
operator- the operator- Returns:
- the copy
-
toString
-
hashCode
-
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). -
formatType
public net.minestom.server.scoreboard.Sidebar.NumberFormat.FormatType formatType()Returns the value of theformatTyperecord component.- Returns:
- the value of the
formatTyperecord component
-
content
-