Kommentar zu Records eingefügt.
parent
7e016fafdf
commit
1e948c6ef3
|
@ -2,6 +2,10 @@ package de.th_mannheim.informatik.blackjack.facade.dtos;
|
|||
|
||||
import de.th_mannheim.informatik.blackjack.domain.Card;
|
||||
|
||||
// Records sind "immutable data classes", die seit Version 14 verfügbar sind.
|
||||
// Sie benötigen nur die Angaben der gewünschten Attribute, auf die per Punkt-Notation
|
||||
// zugegriffen werden kann.
|
||||
|
||||
public record CardDTO(String name, int points) {
|
||||
public CardDTO(Card card) {
|
||||
this(card.toString(), card.getPoints());
|
||||
|
|
Loading…
Reference in New Issue