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
ConstructorsConstructorDescriptionFireworkEffectWrapper(FireworkEffect.Type type, List<Color> colors, List<Color> fadeColors, boolean flicker, boolean trail) Creates an instance of aFireworkEffectWrapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolors()Returns the value of thecolorsrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefadeColorsrecord component.booleanflicker()Returns the value of theflickerrecord component.final inthashCode()Returns a hash code value for this object.static FireworkEffectWrapperof(FireworkEffect fireworkEffect) Create a newFireworkEffectWrapperbased on aFireworkEffect.Constructs a newFireworkEffectbased on wrapper values.final StringtoString()Returns a string representation of this record class.booleantrail()Returns the value of thetrailrecord component.type()Returns the value of thetyperecord component.
-
Constructor Details
-
FireworkEffectWrapper
public FireworkEffectWrapper(FireworkEffect.Type type, List<Color> colors, List<Color> fadeColors, boolean flicker, boolean trail) Creates an instance of aFireworkEffectWrapperrecord class.- Parameters:
type- the value for thetyperecord componentcolors- the value for thecolorsrecord componentfadeColors- the value for thefadeColorsrecord componentflicker- the value for theflickerrecord componenttrail- the value for thetrailrecord component
-
-
Method Details
-
of
Create a newFireworkEffectWrapperbased on aFireworkEffect.- Parameters:
fireworkEffect- firework effect instance- Returns:
- new
FireworkEffectWrapperinstance
-
toFireworkEffect
Constructs a newFireworkEffectbased on wrapper values.- Returns:
- new
FireworkEffectinstance
-
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 thetyperecord component.- Returns:
- the value of the
typerecord component
-
colors
Returns the value of thecolorsrecord component.- Returns:
- the value of the
colorsrecord component
-
fadeColors
Returns the value of thefadeColorsrecord component.- Returns:
- the value of the
fadeColorsrecord component
-
flicker
public boolean flicker()Returns the value of theflickerrecord component.- Returns:
- the value of the
flickerrecord component
-
trail
public boolean trail()Returns the value of thetrailrecord component.- Returns:
- the value of the
trailrecord component
-