Record Class BannerMeta.Pattern
java.lang.Object
java.lang.Record
net.minestom.server.item.metadata.BannerMeta.Pattern
- Enclosing class:
BannerMeta
public static record BannerMeta.Pattern(@NotNull DyeColor color, @NotNull BannerPattern pattern)
extends Record
-
Constructor Summary
ConstructorDescriptionPattern
(@NotNull DyeColor color, @NotNull BannerPattern pattern) Creates an instance of aPattern
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound
Retrieves theBannerMeta.Pattern
as anNBTCompound
.@NotNull DyeColor
color()
Returns the value of thecolor
record component.final boolean
Indicates whether some other object is "equal to" this one.static @NotNull BannerMeta.Pattern
fromCompound
(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound) Retrieves a banner pattern from the givencompound
.final int
hashCode()
Returns a hash code value for this object.@NotNull BannerPattern
pattern()
Returns the value of thepattern
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Pattern
Creates an instance of aPattern
record class.- Parameters:
color
- the value for thecolor
record componentpattern
- the value for thepattern
record component
-
-
Method Details
-
fromCompound
@NotNull public static @NotNull BannerMeta.Pattern fromCompound(@NotNull @NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound) Retrieves a banner pattern from the givencompound
.- Parameters:
compound
- The NBT connection, which should be a banner pattern.- Returns:
- A new created banner pattern.
-
asCompound
@NotNull public @NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound asCompound()Retrieves theBannerMeta.Pattern
as anNBTCompound
.- Returns:
- The banner pattern as a nbt compound.
-
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
-