人生苦短,我用Lombok

编者按

         得益于JSR269 api标准,我们可以愉快地在编译期处理注解。


目录

一、 常用注解
二、 使用方法

一、常用注解

1.1 类构造

注解(位置TYPE)/属性 staticName
私有化生产的构造器并生成一个静态构造方法
onConstructor
在生成的构造器上增加其他注解
access
设置生成的构造器的可见性
force
为true时,初始化所有静态属性到0/false/null
@AllArgsConstructor
生成一个全参构造器
@RequiredArgsConstructor
生成一个必要参数构造器
@NoArgsConstructor
生成一个空参构造器
注解(位置) 属性
@Builder
(TYPE,METHOD,
CONSTRUCTOR)
生成目标类的一个建造者内部类
builderClassName:自定义建造类(TypeName)Builder的类名
builderMethodName:自定义builder()的方法名
buildMethodName:自定义build()的方法名
toBuilder
@Builder.ObtainVia
(FIELD,PARAMETER)
注明一个参数或属性的获取方式
field:使用this.field赋值
method:使用this.method()赋值
isStatic:使用SelfType.method(this)赋值,要求mthod是静态的
@Builder.Default(FIELD)
注明一个属性有默认值
@Singular
(FIELD,PARAMETER)
允许为集合类型的属性一项一项赋值
value:单项赋值方法的方法名

1.2 类属性

注解(位置) 属性
@Getter(TYPE,FIELD)
自动生成标准的getter方法
lazy:默认false,不可用
onMethod:在方法上增加其他注解
value:设置方法的可见性
@Setter(TYPE,FIELD)
自动生成标准的setter方法
onParam:在方法参数上增加其他注解
onMethod:同@Getter.onMethod
value:同@Getter.value
@Data(TYPE)
@Getter/@Setter,@ToString,
@EqualsAndHashCode和@RequiredArgsConstructor
组合的便捷写法
staticConstructor:同@RequiredArgsConstructor.staticName
@EqualsAndHashCode(TYPE)
利用父类方法和相关属性生成equals()和hashCode()
callSuper:在使用本类属性前先使用父类方法计算
doNotUseGetters:不使用getter方法
exclude:计算时不使用这里罗列的属性
of:计算时使用这里罗列的属性
onParam:同@Setter.onParam
@ToString(TYPE)
利用父类方法和相关属性生成
callSuper:同@EqualsAndHashCode.callSuper
doNotUseGetters:同@EqualsAndHashCode.doNotUseGetters
exclude:同@EqualsAndHashCode.exclude
of:同@EqualsAndHashCode.of
includeFieldNames:是否打印属性名

1.3 日志

注解(位置TYPE) 日志类类型 属性
@CommonsLog org.apache.commons.logging.Log topic:自定义标题
@Log java.util.logging.Logger topic:同上
@JBossLog org.jboss.logging.Logger topic:同上
@Log4j org.apache.log4j.Logger topic:同上
@Log4j2 org.apache.logging.log4j.Logger topic:同上
@Slf4j org.slf4j.Logger topic:同上
@Slf4j2 org.slf4j.ext.XLogger topic:同上

关于日志上的注解,重点应该放在日志类型的选择上。一般情况下优先使用@Slf4j或@Slf4j2

1.4 杂项

注解(位置) 属性
@NonNull
(FIELD,METHOD,PARAMETER,LOCAL_VARIABLE)
自动生成引用空检查代码,为空时抛出空指针异常
@SneakThrows(METHOD,CONSTRUCTOR)
自动生成代码,抛出受检异常
value:需要向上抛出的异常类型
@Synchronized(METHOD)
被标注的方法使用生成的锁对象($lock和$Lock)而非默认的(this和SlefType)
value:使用指定的属性作为锁对象
@Value(TYPE)
便捷地转化可变类到不可变
staticConstructor:同@RequiredArgsConstructor.staticName
@Cleanup(LOCAL_VARIABLE)
生成自动关闭资源的代码
value:使用指定的方法关闭资源,默认使用close()
  • val 便捷地声明final局部变量的类型(主要用于含有类型推断的情况)
  • var val的非final情况

        除了上述提到的注解和类,在lombok.experimental中还包含一些处于实验阶段中的注解(例如自动生成代理方法的@Delegate等)和类,这里不再描述。


二、使用方法

2.1 Javac

javac -cp lombok.jar ...

2.2 Maven

<dependencies>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.4</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

2.3 IntelliJ IDEA

  • 菜单栏 :文件(File) > 设置(Setting) > 插件(Plugins
  • 点击:浏览仓库(Browse repositories...
  • 查找:Lombok Plugin
  • 点击:安装插件(Install plugin
  • 重启软件

示例代码

1.1 类构造

// 原始代码
@AllArgsConstructor(
    access = AccessLevel.PUBLIC, 
    onConstructor_ = {@SneakyThrows(Exception.class)})
@RequiredArgsConstructor(
    access = AccessLevel.PROTECTED, 
    staticName = "ofRequiredArgs")
@NoArgsConstructor(
    access = AccessLevel.PRIVATE, 
    force = true)
public class Example {
    private final String privateFianlString;
    private String privateString;
}
// 编译后
public class Example {
    private final String privateFianlString;
    private String privateString;

    public Example(String privateFianlString, String privateString) {
        try {
            this.privateFianlString = privateFianlString;
            this.privateString = privateString;
        } catch (Exception var4) {
            throw var4;
        }
    }

    private Example(String privateFianlString) {
        this.privateFianlString = privateFianlString;
    }

    protected static Example ofRequiredArgs(String privateFianlString) {
        return new Example(privateFianlString);
    }

    private Example() {
        this.privateFianlString = null;
    }
}

// 原始代码
@Builder(
        builderClassName = "ExampleBuilder2",
        builderMethodName = "builder2",
        buildMethodName = "build2",
        toBuilder = true)
public class Example {

    private static final String STRING = "defaultString2";
    private String getDefaultString() { return STRING;}
    private static String getDefaultString2() { return STRING;}

    private final String fString;
    @Builder.Default
    private String string = "defaultString";
    private String string2;
    @Builder.ObtainVia(field = "STRING")
    private String string3;
    @Builder.ObtainVia(method = "getDefaultString")
    private String string4;
    @Builder.ObtainVia(method = "getDefaultString2", isStatic = true)
    private String string5;

    @Singular private List<String> listStrings;
    @Singular("listString2e") private List<String> listString2s;
}
// 编译后
public class Example {
    private static final String STRING = "defaultString2";
    private final String fString;
    private String string;
    private String string2;
    private String string3;
    private String string4;
    private String string5;
    private List<String> listStrings;
    private List<String> listString2s;

    private String getDefaultString() {
        return "defaultString2";
    }

    private static String getDefaultString2(Example example) {
        return example.fString;
    }

    private static String $default$string() {
        return "defaultString";
    }

    Example(String fString, String string, String string2, String string3, String string4, String string5, List<String> listStrings, List<String> listString2s) {
        this.fString = fString;
        this.string = string;
        this.string2 = string2;
        this.string3 = string3;
        this.string4 = string4;
        this.string5 = string5;
        this.listStrings = listStrings;
        this.listString2s = listString2s;
    }

    public static ExampleBuilder2 builder2() {
        return new ExampleBuilder2();
    }

    public ExampleBuilder2 toBuilder() {
        ExampleBuilder2 builder = (new ExampleBuilder2()).fString(this.fString).string(this.string).string2(this.string2).string3("defaultString2").string4(this.getDefaultString()).string5(getDefaultString2(this));
        if (this.listStrings != null) {
            builder.listStrings(this.listStrings);
        }

        if (this.listString2s != null) {
            builder.listString2s(this.listString2s);
        }

        return builder;
    }
}

public class Example$ExampleBuilder2 {
    private String fString;
    private boolean string$set;
    private String string;
    private String string2;
    private String string3;
    private String string4;
    private String string5;
    private ArrayList<String> listStrings;
    private ArrayList<String> listString2s;

    Example$ExampleBuilder2() {
    }

    public Example$ExampleBuilder2 fString(String fString) {
        this.fString = fString;
        return this;
    }

    public Example$ExampleBuilder2 string(String string) {
        this.string = string;
        this.string$set = true;
        return this;
    }

    public Example$ExampleBuilder2 string2(String string2) {
        this.string2 = string2;
        return this;
    }

    public Example$ExampleBuilder2 string3(String string3) {
        this.string3 = string3;
        return this;
    }

    public Example$ExampleBuilder2 string4(String string4) {
        this.string4 = string4;
        return this;
    }

    public Example$ExampleBuilder2 string5(String string5) {
        this.string5 = string5;
        return this;
    }

    public Example$ExampleBuilder2 listString(String listString) {
        if (this.listStrings == null) {
            this.listStrings = new ArrayList();
        }

        this.listStrings.add(listString);
        return this;
    }

    public Example$ExampleBuilder2 listStrings(Collection<? extends String> listStrings) {
        if (this.listStrings == null) {
            this.listStrings = new ArrayList();
        }

        this.listStrings.addAll(listStrings);
        return this;
    }

    public Example$ExampleBuilder2 clearListStrings() {
        if (this.listStrings != null) {
            this.listStrings.clear();
        }

        return this;
    }

    public Example$ExampleBuilder2 listString2e(String listString2e) {
        if (this.listString2s == null) {
            this.listString2s = new ArrayList();
        }

        this.listString2s.add(listString2e);
        return this;
    }

    public Example$ExampleBuilder2 listString2s(Collection<? extends String> listString2s) {
        if (this.listString2s == null) {
            this.listString2s = new ArrayList();
        }

        this.listString2s.addAll(listString2s);
        return this;
    }

    public Example$ExampleBuilder2 clearListString2s() {
        if (this.listString2s != null) {
            this.listString2s.clear();
        }

        return this;
    }

    public Example build2() {
        List listStrings;
        switch(this.listStrings == null ? 0 : this.listStrings.size()) {
        case 0:
            listStrings = Collections.emptyList();
            break;
        case 1:
            listStrings = Collections.singletonList(this.listStrings.get(0));
            break;
        default:
            listStrings = Collections.unmodifiableList(new ArrayList(this.listStrings));
        }

        List listString2s;
        switch(this.listString2s == null ? 0 : this.listString2s.size()) {
        case 0:
            listString2s = Collections.emptyList();
            break;
        case 1:
            listString2s = Collections.singletonList(this.listString2s.get(0));
            break;
        default:
            listString2s = Collections.unmodifiableList(new ArrayList(this.listString2s));
        }

        String string = this.string;
        if (!this.string$set) {
            string = Example.access$000();
        }

        return new Example(this.fString, string, this.string2, this.string3, this.string4, this.string5, listStrings, listString2s);
    }

    public String toString() {
        return "Example.ExampleBuilder2(fString=" + this.fString + ", string=" + this.string + ", string2=" + this.string2 + ", string3=" + this.string3 + ", string4=" + this.string4 + ", string5=" + this.string5 + ", listStrings=" + this.listStrings + ", listString2s=" + this.listString2s + ")";
    }
}

1.2 类属性

// 原始代码
@Setter(
        value = AccessLevel.PRIVATE,
        onParam_ = {@NonNull},
        onMethod_ = {@Deprecated})
@EqualsAndHashCode(
        callSuper = false,
        doNotUseGetters = true,
        exclude = {"string"},
        onParam_ = {@NonNull})
@ToString(
        callSuper = true,
        doNotUseGetters = false,
        of = {"string2"},
        includeFieldNames = false)
public class Example {
    @Getter(
            value = AccessLevel.PUBLIC,
            onMethod_ = {@Deprecated})
    private String string;
    @Getter( value = AccessLevel.PROTECTED)
    private String string2;
    private String string3;
}
// 编译后
public class Example {
    private String string;
    private String string2;
    private String string3;

    public Example() {
    }

    /** @deprecated */
    @Deprecated
    private void setString(@NonNull String string) {
        if (string == null) {
            throw new NullPointerException("string is marked @NonNull but is null");
        } else {
            this.string = string;
        }
    }

    /** @deprecated */
    @Deprecated
    private void setString2(@NonNull String string2) {
        if (string2 == null) {
            throw new NullPointerException("string2 is marked @NonNull but is null");
        } else {
            this.string2 = string2;
        }
    }

    /** @deprecated */
    @Deprecated
    private void setString3(@NonNull String string3) {
        if (string3 == null) {
            throw new NullPointerException("string3 is marked @NonNull but is null");
        } else {
            this.string3 = string3;
        }
    }

    public boolean equals(@NonNull Object o) {
        if (o == null) {
            throw new NullPointerException("o is marked @NonNull but is null");
        } else if (o == this) {
            return true;
        } else if (!(o instanceof Example)) {
            return false;
        } else {
            Example other = (Example)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$string2 = this.string2;
                Object other$string2 = other.string2;
                if (this$string2 == null) {
                    if (other$string2 != null) {
                        return false;
                    }
                } else if (!this$string2.equals(other$string2)) {
                    return false;
                }

                Object this$string3 = this.string3;
                Object other$string3 = other.string3;
                if (this$string3 == null) {
                    if (other$string3 != null) {
                        return false;
                    }
                } else if (!this$string3.equals(other$string3)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(@NonNull Object other) {
        return other instanceof Example;
    }

    public int hashCode() {
        int PRIME = true;
        int result = 1;
        Object $string2 = this.string2;
        int result = result * 59 + ($string2 == null ? 43 : $string2.hashCode());
        Object $string3 = this.string3;
        result = result * 59 + ($string3 == null ? 43 : $string3.hashCode());
        return result;
    }

    public String toString() {
        return "Example(super=" + super.toString() + ", " + this.getString2() + ")";
    }

    /** @deprecated */
    @Deprecated
    public String getString() {
        return this.string;
    }

    protected String getString2() {
        return this.string2;
    }
}

// 原始代码
@Data
public class Example {
    private String string;
    private String string2;
    private String string3;
}
// 编译后
public class Example {
    private String string;
    private String string2;
    private String string3;

    public Example() {
    }

    public String getString() {
        return this.string;
    }

    public String getString2() {
        return this.string2;
    }

    public String getString3() {
        return this.string3;
    }

    public void setString(String string) {
        this.string = string;
    }

    public void setString2(String string2) {
        this.string2 = string2;
    }

    public void setString3(String string3) {
        this.string3 = string3;
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof Example)) {
            return false;
        } else {
            Example other = (Example)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                label47: {
                    Object this$string = this.getString();
                    Object other$string = other.getString();
                    if (this$string == null) {
                        if (other$string == null) {
                            break label47;
                        }
                    } else if (this$string.equals(other$string)) {
                        break label47;
                    }

                    return false;
                }

                Object this$string2 = this.getString2();
                Object other$string2 = other.getString2();
                if (this$string2 == null) {
                    if (other$string2 != null) {
                        return false;
                    }
                } else if (!this$string2.equals(other$string2)) {
                    return false;
                }

                Object this$string3 = this.getString3();
                Object other$string3 = other.getString3();
                if (this$string3 == null) {
                    if (other$string3 != null) {
                        return false;
                    }
                } else if (!this$string3.equals(other$string3)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof Example;
    }

    public int hashCode() {
        int PRIME = true;
        int result = 1;
        Object $string = this.getString();
        int result = result * 59 + ($string == null ? 43 : $string.hashCode());
        Object $string2 = this.getString2();
        result = result * 59 + ($string2 == null ? 43 : $string2.hashCode());
        Object $string3 = this.getString3();
        result = result * 59 + ($string3 == null ? 43 : $string3.hashCode());
        return result;
    }

    public String toString() {
        return "Example(string=" + this.getString() + ", string2=" + this.getString2() + ", string3=" + this.getString3() + ")";
    }
}

1.3 日志

// 原始代码
@Log
public class Example { }
// 编译后
public class Example {
    private static final Logger log = Logger.getLogger(Example.class.getName());

    public Example() {
    }
}

1.4 杂项

// 原始代码
@AllArgsConstructor(onConstructor_ = {@SneakyThrows})
@Value( staticConstructor = "of")
public class Example {

    private Object f2Lock = new Object();

    @NonNull
    private String string;
    private String string2;
    private String string3;

    @Synchronized @SneakyThrows({FileNotFoundException.class, MalformedURLException.class, IOException.class})
    public void f(@NonNull String string) {
        @Cleanup @NonNull
        InputStream inputStream = new FileInputStream("");
    }

    @Synchronized("f2Lock") @NonNull
    public void f2() {
        System.out.println("Hello,World");
    }

    @Synchronized
    public static void f3() {
        System.out.println("Hello,World");
    }
}
// 编译后
public final class Example {
    private final Object $lock = new Object[0];
    private static final Object $LOCK = new Object[0];
    private final Object f2Lock = new Object();
    @NonNull
    private final String string;
    private final String string2;
    private final String string3;

    public void f(@NonNull String string) {
        try {
            try {
                try {
                    Object var2 = this.$lock;
                    synchronized(this.$lock) {
                        if (string == null) {
                            throw new NullPointerException("string is marked @NonNull but is null");
                        } else {
                            InputStream inputStream = new FileInputStream("");
                            if (Collections.singletonList(inputStream).get(0) != null) {
                                inputStream.close();
                            }

                        }
                    }
                } catch (FileNotFoundException var6) {
                    throw var6;
                }
            } catch (MalformedURLException var7) {
                throw var7;
            }
        } catch (IOException var8) {
            throw var8;
        }
    }

    @NonNull
    public void f2() {
        Object var1 = this.f2Lock;
        synchronized(this.f2Lock) {
            System.out.println("Hello,World");
        }
    }

    public static void f3() {
        Object var0 = $LOCK;
        synchronized($LOCK) {
            System.out.println("Hello,World");
        }
    }

    public Object getF2Lock() {
        return this.f2Lock;
    }

    @NonNull
    public String getString() {
        return this.string;
    }

    public String getString2() {
        return this.string2;
    }

    public String getString3() {
        return this.string3;
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof Example)) {
            return false;
        } else {
            Example other;
            label56: {
                other = (Example)o;
                Object this$f2Lock = this.getF2Lock();
                Object other$f2Lock = other.getF2Lock();
                if (this$f2Lock == null) {
                    if (other$f2Lock == null) {
                        break label56;
                    }
                } else if (this$f2Lock.equals(other$f2Lock)) {
                    break label56;
                }

                return false;
            }

            label49: {
                Object this$string = this.getString();
                Object other$string = other.getString();
                if (this$string == null) {
                    if (other$string == null) {
                        break label49;
                    }
                } else if (this$string.equals(other$string)) {
                    break label49;
                }

                return false;
            }

            Object this$string2 = this.getString2();
            Object other$string2 = other.getString2();
            if (this$string2 == null) {
                if (other$string2 != null) {
                    return false;
                }
            } else if (!this$string2.equals(other$string2)) {
                return false;
            }

            Object this$string3 = this.getString3();
            Object other$string3 = other.getString3();
            if (this$string3 == null) {
                if (other$string3 != null) {
                    return false;
                }
            } else if (!this$string3.equals(other$string3)) {
                return false;
            }

            return true;
        }
    }

    public int hashCode() {
        int PRIME = true;
        int result = 1;
        Object $f2Lock = this.getF2Lock();
        int result = result * 59 + ($f2Lock == null ? 43 : $f2Lock.hashCode());
        Object $string = this.getString();
        result = result * 59 + ($string == null ? 43 : $string.hashCode());
        Object $string2 = this.getString2();
        result = result * 59 + ($string2 == null ? 43 : $string2.hashCode());
        Object $string3 = this.getString3();
        result = result * 59 + ($string3 == null ? 43 : $string3.hashCode());
        return result;
    }

    public String toString() {
        return "Example(f2Lock=" + this.getF2Lock() + ", string=" + this.getString() + ", string2=" + this.getString2() + ", string3=" + this.getString3() + ")";
    }

    public Example(@NonNull String string, String string2, String string3) {
        try {
            if (string == null) {
                throw new NullPointerException("string is marked @NonNull but is null");
            } else {
                this.string = string;
                this.string2 = string2;
                this.string3 = string3;
            }
        } catch (Throwable var5) {
            throw var5;
        }
    }
}
// 原始代码
public class Example {
    public static void main(String[] args) {
        val list = Arrays.asList("123","234");
        var list2 = Arrays.asList("123","234");
        list2 = list;
    }
}
// 编译后
public class Example {
    public Example() {
    }

    public static void main(String[] args) {
        List<String> list = Arrays.asList("123", "234");
        List<String> list2 = Arrays.asList("123", "234");
    }
}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 205,033评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 87,725评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,473评论 0 338
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,846评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,848评论 5 368
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,691评论 1 282
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,053评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,700评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 42,856评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,676评论 2 323
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,787评论 1 333
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,430评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,034评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,990评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,218评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,174评论 2 352
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,526评论 2 343

推荐阅读更多精彩内容