第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Java + 龍目島 + 番石榴 + 驗證

Java + 龍目島 + 番石榴 + 驗證

紅糖糍粑 2023-02-23 18:20:04
我有這個 Pojo:@Getter@EqualsAndHashCodepublic class Order {    public enum OrderType {        BUY, SELL    }    private Id id;    private Quantity quantity;    private Money price;    private OrderType orderType;    public Order(Id id, Quantity quantity, Money price, OrderType orderType) {        Preconditions.checkNotNull(id, "id can't be null");        Preconditions.checkNotNull(quantity, "quantity can't be null");        Preconditions.checkNotNull(price, "price can't be null");        Preconditions.checkNotNull(orderType, "orderType can't be null");        this.id = id;        this.quantity = quantity;        this.price = price;        this.orderType = orderType;    }我想做三件事:使用 @AllArgsConstructor 代替并刪除構(gòu)造函數(shù)但當然要保持先決條件這可能嗎?我也喜歡使用 @Builder 模式,我可以將前提條件與這種方法結(jié)合起來嗎?
查看完整描述

1 回答

?
躍然一笑

TA貢獻1826條經(jīng)驗 獲得超6個贊

標記所有字段并@lombok.NonNull使用@RequiredArgsConstructor; 應(yīng)該這樣做。



查看完整回答
反對 回復(fù) 2023-02-23
  • 1 回答
  • 0 關(guān)注
  • 97 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號