private final String userName; private final int cardTypeId; @NotNull private final String cardNumber; @NotNull private final String cardSecurityNumber; @NotNull private final String cardHolderName; @NotNull private final Instant cardExpiration; @NotNull private final Order order; public LegoSetBookedEvent( @NotNull String userId, @NotNull String userName, int cardTypeId, @NotNull String cardNumber, @NotNull String cardSecurityNumber, @NotNull String cardHolderName, @NotNull Instant cardExpiration, @NotNull Order order ) { Objects.requireNonNull(userId, "userId"); Objects.requireNonNull(userName, "userName"); Objects.requireNonNull(cardNumber, "cardNumber"); Objects.requireNonNull(cardSecurityNumber, "cardSecurityNumber"); Objects.requireNonNull(cardHolderName, "cardHolderName"); Objects.requireNonNull(cardExpiration, "cardExpiration"); Objects.requireNonNull(order, "order"); this.userId = userId; this.userName = userName; this.cardTypeId = cardTypeId; this.cardNumber = cardNumber; this.cardSecurityNumber = cardSecurityNumber; this.cardHolderName = cardHolderName; this.cardExpiration = cardExpiration; this.order = order; } @NotNull public final String getUserId() { return this.userId; } @NotNull public final String getUserName() { return this.userName; } public final int getCardTypeId() { return this.cardTypeId; } @NotNull public final String getCardNumber() { return this.cardNumber; } @NotNull public final String getCardSecurityNumber() { return this.cardSecurityNumber; } @NotNull public final String getCardHolderName() { return this.cardHolderName; } @NotNull public final Instant getCardExpiration() { return this.cardExpiration; } @NotNull public final Order getOrder() { return this.order; } @NotNull public String toString() { ... } public int hashCode() { ... } public boolean equals(@Nullable Object var1) { ... } } data class LegoSetBookedEvent( val userId: String, val userName: String, val cardTypeId: Int, val cardNumber: String, val cardSecurityNumber: String, val cardHolderName: String, val cardExpiration: Instant, val order: Order, ) public record LegoSetBookedEvent( @NotNull String userId, @NotNull String userName, int cardTypeId, @NotNull String cardNumber, @NotNull String cardSecurityNumber, @NotNull String cardHolderName, @NotNull Instant cardExpiration, @NotNull Order order ) { public LegoSetBookedEvent { Objects.requireNonNull(userId, "userId"); Objects.requireNonNull(userName, "userName"); Objects.requireNonNull(cardNumber, "cardNumber"); Objects.requireNonNull(cardSecurityNumber, "cardSecurityNumber"); Objects.requireNonNull(cardHolderName, "cardHolderName"); Objects.requireNonNull(cardExpiration, "cardExpiration"); Objects.requireNonNull(order, "order"); } } ≦ 13