Record Class LottoZahlRecord
java.lang.Object
java.lang.Record
de.eldecker.dhbw.lottozahlen.engine.model.LottoZahlRecord
- Record Components:
lottozahl- Eine Zahl von 1..MAX_ZAHL, z.B. 49 für deutsches Zahlenlotto "6 aus 49"zufallszahl- Zufallszahl für zufällige Sortierreihenfolge
Ein Objekt dieses Records repräsentiert eine der Lottozahlen zusammen mit
einer Zufallszahl. Die Zufallszahl wird für die zufällige Sortierreihenfolge
benötigt.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thelottozahlrecord component.private final doubleThe field for thezufallszahlrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionLottoZahlRecord(int lottozahl, double zufallszahl) Creates an instance of aLottoZahlRecordrecord class. -
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.intReturns the value of thelottozahlrecord component.final StringtoString()Returns a string representation of this record class.doubleReturns the value of thezufallszahlrecord component.
-
Field Details
-
lottozahl
private final int lottozahlThe field for thelottozahlrecord component. -
zufallszahl
private final double zufallszahlThe field for thezufallszahlrecord component.
-
-
Constructor Details
-
LottoZahlRecord
public LottoZahlRecord(int lottozahl, double zufallszahl) Creates an instance of aLottoZahlRecordrecord class.- Parameters:
lottozahl- the value for thelottozahlrecord componentzufallszahl- the value for thezufallszahlrecord 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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
lottozahl
-
zufallszahl
public double zufallszahl()Returns the value of thezufallszahlrecord component.- Returns:
- the value of the
zufallszahlrecord component
-