Package net.minestom.server.scoreboard
Record Class Sidebar.NumberFormat
java.lang.Object
java.lang.Record
net.minestom.server.scoreboard.Sidebar.NumberFormat
- Enclosing class:
Sidebar
-
Field Summary
-
Constructor Summary
ConstructorDescriptionNumberFormat
(net.minestom.server.scoreboard.Sidebar.NumberFormat.FormatType formatType, Component content) Creates an instance of aNumberFormat
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Sidebar.NumberFormat
blank()
A number format which has no sidebar score displayedcontent()
Returns the value of thecontent
record component.final boolean
Indicates whether some other object is "equal to" this one.static @NotNull Sidebar.NumberFormat
A number format which lets the sidebar scores be styled with explicit textnet.minestom.server.scoreboard.Sidebar.NumberFormat.FormatType
Returns the value of theformatType
record component.final int
hashCode()
Returns a hash code value for this object.static @NotNull Sidebar.NumberFormat
A number format which lets the sidebar scores be styledfinal String
toString()
Returns a string representation of this record class.
-
Field Details
-
SERIALIZER
-
-
Constructor Details
-
NumberFormat
public NumberFormat(net.minestom.server.scoreboard.Sidebar.NumberFormat.FormatType formatType, Component content) Creates an instance of aNumberFormat
record class.- Parameters:
formatType
- the value for theformatType
record componentcontent
- the value for thecontent
record 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
-
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)
. -
formatType
public net.minestom.server.scoreboard.Sidebar.NumberFormat.FormatType formatType()Returns the value of theformatType
record component.- Returns:
- the value of the
formatType
record component
-
content
Returns the value of thecontent
record component.- Returns:
- the value of the
content
record component
-