Record Class Fireworks
java.lang.Object
java.lang.Record
com.viaversion.viaversion.api.minecraft.item.data.Fireworks
- All Implemented Interfaces:
Copyable
public record Fireworks(int flightDuration, FireworkExplosion[] explosions)
extends Record
implements Copyable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFireworks(int flightDuration, FireworkExplosion[] explosions) Creates an instance of aFireworksrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncopy()final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexplosionsrecord component.intReturns the value of theflightDurationrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
TYPE
-
-
Constructor Details
-
Fireworks
Creates an instance of aFireworksrecord class.- Parameters:
flightDuration- the value for theflightDurationrecord componentexplosions- the value for theexplosionsrecord component
-
-
Method Details
-
copy
-
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 '=='. -
flightDuration
public int flightDuration()Returns the value of theflightDurationrecord component.- Returns:
- the value of the
flightDurationrecord component
-
explosions
Returns the value of theexplosionsrecord component.- Returns:
- the value of the
explosionsrecord component
-