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 int
The field for thelottozahl
record component.private final double
The field for thezufallszahl
record component. -
Constructor Summary
ConstructorsConstructorDescriptionLottoZahlRecord
(int lottozahl, double zufallszahl) Creates an instance of aLottoZahlRecord
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of thelottozahl
record component.final String
toString()
Returns a string representation of this record class.double
Returns the value of thezufallszahl
record component.
-
Field Details
-
lottozahl
private final int lottozahlThe field for thelottozahl
record component. -
zufallszahl
private final double zufallszahlThe field for thezufallszahl
record component.
-
-
Constructor Details
-
LottoZahlRecord
public LottoZahlRecord(int lottozahl, double zufallszahl) Creates an instance of aLottoZahlRecord
record class.- Parameters:
lottozahl
- the value for thelottozahl
record componentzufallszahl
- the value for thezufallszahl
record 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 thecompare
method from their corresponding wrapper classes. -
lottozahl
-
zufallszahl
public double zufallszahl()Returns the value of thezufallszahl
record component.- Returns:
- the value of the
zufallszahl
record component
-