Record Class StatisticsPacket.Statistic
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.StatisticsPacket.Statistic
- All Implemented Interfaces:
NetworkBuffer.Writer
- Enclosing class:
StatisticsPacket
public static record StatisticsPacket.Statistic(@NotNull StatisticCategory category, int statisticId, int value)
extends Record
implements NetworkBuffer.Writer
-
Constructor Summary
ConstructorDescriptionStatistic
(@NotNull NetworkBuffer reader) Statistic
(@NotNull StatisticCategory category, int statisticId, int value) Creates an instance of aStatistic
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull StatisticCategory
category()
Returns the value of thecategory
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.int
Returns the value of thestatisticId
record component.final String
toString()
Returns a string representation of this record class.int
value()
Returns the value of thevalue
record component.void
write
(@NotNull NetworkBuffer writer)
-
Constructor Details
-
Statistic
-
Statistic
Creates an instance of aStatistic
record class.- Parameters:
category
- the value for thecategory
record componentstatisticId
- the value for thestatisticId
record componentvalue
- the value for thevalue
record component
-
-
Method Details
-
write
- Specified by:
write
in interfaceNetworkBuffer.Writer
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
category
Returns the value of thecategory
record component.- Returns:
- the value of the
category
record component
-
statisticId
public int statisticId()Returns the value of thestatisticId
record component.- Returns:
- the value of the
statisticId
record component
-
value
public int value()Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-