Package com.wdiscute.starcatcher.io
Record Class CaughtFishInfo
java.lang.Object
java.lang.Record
com.wdiscute.starcatcher.io.CaughtFishInfo
public record CaughtFishInfo(int sizeInCentimeters, int weightInGrams, float percentile, FishProperties.Rarity rarity, boolean golden)
extends Record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCaughtFishInfo(int sizeInCentimeters, int weightInGrams, float percentile, FishProperties.Rarity rarity, boolean golden) Creates an instance of aCaughtFishInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.floatgetScale()booleangolden()Returns the value of thegoldenrecord component.final inthashCode()Returns a hash code value for this object.floatReturns the value of thepercentilerecord component.rarity()Returns the value of therarityrecord component.intReturns the value of thesizeInCentimetersrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of theweightInGramsrecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
CaughtFishInfo
public CaughtFishInfo(int sizeInCentimeters, int weightInGrams, float percentile, FishProperties.Rarity rarity, boolean golden) Creates an instance of aCaughtFishInforecord class.- Parameters:
sizeInCentimeters- the value for thesizeInCentimetersrecord componentweightInGrams- the value for theweightInGramsrecord componentpercentile- the value for thepercentilerecord componentrarity- the value for therarityrecord componentgolden- the value for thegoldenrecord component
-
-
Method Details
-
getScale
public float getScale() -
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 '=='. -
sizeInCentimeters
public int sizeInCentimeters()Returns the value of thesizeInCentimetersrecord component.- Returns:
- the value of the
sizeInCentimetersrecord component
-
weightInGrams
public int weightInGrams()Returns the value of theweightInGramsrecord component.- Returns:
- the value of the
weightInGramsrecord component
-
percentile
public float percentile()Returns the value of thepercentilerecord component.- Returns:
- the value of the
percentilerecord component
-
rarity
Returns the value of therarityrecord component.- Returns:
- the value of the
rarityrecord component
-
golden
public boolean golden()Returns the value of thegoldenrecord component.- Returns:
- the value of the
goldenrecord component
-