簡體   English   中英

如何在Java類中訪問Kotlin Pojo

[英]How to access kotlin pojo in java class

class Example {

    @SerializedName("foo")
    @Expose
    var foo: String? = null
    @SerializedName("bar")
    @Expose
    var bar: String? = null
    @SerializedName("baz")
    @Expose
    var baz: String? = null
}

如何在Java類中訪問Kotlin Pojo類屬性

我們可以如下訪問

    Example example = new Example();
    example.setBar("");
    example.setBaz("");
    example.setFoo("");
    example.getBar();
    example.getBaz();
    example.getFoo();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM