Skip to content
Evgeniy edited this page Jan 10, 2023 · 1 revision

Create entity with lombok

@Accessors(chain = true)
@Setter
@FieldDefaults(level = PRIVATE)
@ToString
@EqualsAndHashCode
public class TSenderCard implements ICardInfo {

    @Getter(onMethod_ = @Column(name = "sender_card_id"))
    long senderCardId;

    @Getter(onMethod_ = @Column(name = "card_friendly_name"))
    String cardFriendlyName;

    @Getter(onMethod_ = @Column(name = "card_scheme"))
    String cardScheme;

    @Transient
    public Optional<CardSchemeType> getCardScheme() {
        return Strings.hasText(cardScheme) ? Optional.of(CardSchemeType.valueOf(cardScheme)) : Optional.empty();
    }

}
Clone this wiki locally