Record Class PatternWrapper
java.lang.Object
java.lang.Record
de.eldoria.jacksonbukkit.entities.PatternWrapper
Class for wrapping a
Pattern.-
Constructor Summary
ConstructorsConstructorDescriptionPatternWrapper(DyeColor color, PatternType pattern) Creates an instance of aPatternWrapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolor()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static PatternWrapperCreate a newPatternWrapperbased on aPattern.pattern()Returns the value of thepatternrecord component.Constructs a newPatternbased on wrapper values.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PatternWrapper
Creates an instance of aPatternWrapperrecord class.- Parameters:
color- the value for thecolorrecord componentpattern- the value for thepatternrecord component
-
-
Method Details
-
of
Create a newPatternWrapperbased on aPattern.- Parameters:
pattern- pattern instance- Returns:
- new
PatternWrapperinstance
-
toBukkitPattern
Constructs a newPatternbased on wrapper values.- Returns:
- new
Patterninstance
-
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). -
color
Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-
pattern
Returns the value of thepatternrecord component.- Returns:
- the value of the
patternrecord component
-