Package com.pixelmonmod.tcg.api.card
Record Class CardRarity
java.lang.Object
java.lang.Record
com.pixelmonmod.tcg.api.card.CardRarity
public record CardRarity(int color, ResourceWithFallback texture, boolean rareOrHigher)
extends Record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCardRarity(int color, ResourceWithFallback texture, boolean rareOrHigher) Creates an instance of aCardRarityrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcolor()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.booleanReturns the value of therareOrHigherrecord component.texture()Returns the value of thetexturerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
CardRarity
Creates an instance of aCardRarityrecord class.- Parameters:
color- the value for thecolorrecord componenttexture- the value for thetexturerecord componentrareOrHigher- the value for therareOrHigherrecord component
-
-
Method Details
-
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 '=='. -
color
public int color()Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-
texture
Returns the value of thetexturerecord component.- Returns:
- the value of the
texturerecord component
-
rareOrHigher
public boolean rareOrHigher()Returns the value of therareOrHigherrecord component.- Returns:
- the value of the
rareOrHigherrecord component
-