Record Class PatternWrapper
java.lang.Object
java.lang.Record
de.eldoria.jacksonbukkit.entities.PatternWrapper
Class for wrapping a
Pattern
.-
Constructor Summary
ConstructorDescriptionPatternWrapper
(DyeColor color, PatternType pattern) Creates an instance of aPatternWrapper
record class. -
Method Summary
Modifier and TypeMethodDescriptioncolor()
Returns the value of thecolor
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.static PatternWrapper
Create a newPatternWrapper
based on aPattern
.pattern()
Returns the value of thepattern
record component.Constructs a newPattern
based on wrapper values.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
PatternWrapper
Creates an instance of aPatternWrapper
record class.- Parameters:
color
- the value for thecolor
record componentpattern
- the value for thepattern
record component
-
-
Method Details
-
of
Create a newPatternWrapper
based on aPattern
.- Parameters:
pattern
- pattern instance- Returns:
- new
PatternWrapper
instance
-
toBukkitPattern
Constructs a newPattern
based on wrapper values.- Returns:
- new
Pattern
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
color
Returns the value of thecolor
record component.- Returns:
- the value of the
color
record component
-
pattern
Returns the value of thepattern
record component.- Returns:
- the value of the
pattern
record component
-