Record Class FireworkEffectWrapper
java.lang.Object
java.lang.Record
de.eldoria.jacksonbukkit.entities.FireworkEffectWrapper
public record FireworkEffectWrapper(FireworkEffect.Type type, List<Color> colors, List<Color> fadeColors, boolean flicker, boolean trail)
extends Record
Class for wrapping a
FireworkEffect
.-
Constructor Summary
ConstructorDescriptionFireworkEffectWrapper
(FireworkEffect.Type type, List<Color> colors, List<Color> fadeColors, boolean flicker, boolean trail) Creates an instance of aFireworkEffectWrapper
record class. -
Method Summary
Modifier and TypeMethodDescriptioncolors()
Returns the value of thecolors
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefadeColors
record component.boolean
flicker()
Returns the value of theflicker
record component.final int
hashCode()
Returns a hash code value for this object.static FireworkEffectWrapper
of
(FireworkEffect fireworkEffect) Create a newFireworkEffectWrapper
based on aFireworkEffect
.Constructs a newFireworkEffect
based on wrapper values.final String
toString()
Returns a string representation of this record class.boolean
trail()
Returns the value of thetrail
record component.type()
Returns the value of thetype
record component.
-
Constructor Details
-
FireworkEffectWrapper
public FireworkEffectWrapper(FireworkEffect.Type type, List<Color> colors, List<Color> fadeColors, boolean flicker, boolean trail) Creates an instance of aFireworkEffectWrapper
record class.- Parameters:
type
- the value for thetype
record componentcolors
- the value for thecolors
record componentfadeColors
- the value for thefadeColors
record componentflicker
- the value for theflicker
record componenttrail
- the value for thetrail
record component
-
-
Method Details
-
of
Create a newFireworkEffectWrapper
based on aFireworkEffect
.- Parameters:
fireworkEffect
- firework effect instance- Returns:
- new
FireworkEffectWrapper
instance
-
toFireworkEffect
Constructs a newFireworkEffect
based on wrapper values.- Returns:
- new
FireworkEffect
instance
-
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 '=='. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
colors
Returns the value of thecolors
record component.- Returns:
- the value of the
colors
record component
-
fadeColors
Returns the value of thefadeColors
record component.- Returns:
- the value of the
fadeColors
record component
-
flicker
public boolean flicker()Returns the value of theflicker
record component.- Returns:
- the value of the
flicker
record component
-
trail
public boolean trail()Returns the value of thetrail
record component.- Returns:
- the value of the
trail
record component
-