从Kotlin

时间:2015-07-27 08:03:23

标签: kotlin

我有使用标准bean约定的wsimport-ed Java类:

public class Request {
    protected String vin;

    public String getVin() {
        return vin;
    }

    public void setVin(String value) {
        this.vin = value;
    }
}

我希望在Kotlin中使用这个类,使用不错的属性语法:

override fun search(request: Request): Response {
  log.info("search(vin={})", request.vin);
  ...

但是这段代码没有编译:

Error:(59, 64) Kotlin: Cannot access 'vin': it is 'protected/*protected and package*/' in 'SmvSearchRequest'

request.getVin()当然有效,但看起来并不比Java好。有没有办法将这些类作为财产持有人对待?

1 个答案:

答案 0 :(得分:2)

这在M13之前缺失,现在已在M13中修复,请参阅Youtrack

相关问题