Record Class NumismaticAnalyzer.Coin
java.lang.Object
java.lang.Record
org.episteme.social.history.NumismaticAnalyzer.Coin
- All Implemented Interfaces:
Serializable
- Enclosing class:
NumismaticAnalyzer
public static record NumismaticAnalyzer.Coin(String id, double weightGrams, double purityRatio)
extends Record
implements Serializable
Data record representing a historical coin and its metal composition.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.doubleReturns the value of thepurityRatiorecord component.final StringtoString()Returns a string representation of this record class.doubleReturns the value of theweightGramsrecord component.
-
Constructor Details
-
Coin
Creates an instance of aCoinrecord class.- Parameters:
id- the value for theidrecord componentweightGrams- the value for theweightGramsrecord componentpurityRatio- the value for thepurityRatiorecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
weightGrams
public double weightGrams()Returns the value of theweightGramsrecord component.- Returns:
- the value of the
weightGramsrecord component
-
purityRatio
public double purityRatio()Returns the value of thepurityRatiorecord component.- Returns:
- the value of the
purityRatiorecord component
-