英文:
Java Immutable Builder classes not detected by IntelliJ
问题
以下是翻译好的内容:
我一直在想为什么IntelliJ不能检测由Immutables自动生成的类:
RemoteEntityACL
的代码如下:
@Value.Immutable
@Value.Style(visibility = Value.Style.ImplementationVisibility.PRIVATE)
public interface RemoteEntityACL extends Serializable {
@Nullable
@Value.Default
default List<String> read() {
return new LinkedList<>();
}
@Nullable
@Value.Default
default List<String> write() {
return new ArrayList<>();
}
@Nullable
@Value.Default
default Boolean publicRead() {
return false;
}
@Nullable
@Value.Default
default Boolean publicWrite() {
return false;
}
@Nullable
@Value.Default
default List<RemotePropertyACL> propertyACLs() {
return new ArrayList<>();
}
}
这里可能出了什么问题?
英文:
I keep on wondering why IntelliJ cannot detect the classes which are auto-generated by Immutables:
The code for the RemoteEntityACL
is this:
@Value.Immutable
@Value.Style(visibility = Value.Style.ImplementationVisibility.PRIVATE)
public interface RemoteEntityACL extends Serializable {
@Nullable
@Value.Default
default List<String> read() {
return new LinkedList<>();
}
@Nullable
@Value.Default
default List<String> write() {
return new ArrayList<>();
}
@Nullable
@Value.Default
default Boolean publicRead() {
return false;
}
@Nullable
@Value.Default
default Boolean publicWrite() {
return false;
}
@Nullable
@Value.Default
default List<RemotePropertyACL> propertyACLs() {
return new ArrayList<>();
}
}
What could be wrong here?
答案1
得分: 2
更新到最新版本应该有助于解决这个问题:
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<version>2.8.8</version>
</dependency>
英文:
Updating to latest version should help fix this:
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<version>2.8.8</version>
</dependency>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论