我正在尝试安装一些Android开发人员插件.安装完成后,我在控制台中看到此警告3次.为什么会出现这种错误?如何摆脱它?如果我忽略了这个错误,以后会对我有什么影响?
[cloudnotes-preview-android-sample]无法解析目标'Google Inc.:Google API:15'
Javadocs说 distinct() - 返回一个由该流的不同元素(根据 Object.equals(Object))组成的流。
我有一个包含一些重复项的自定义对象列表。当我distinct()在流列表上运行方法时,我仍然得到原始列表。为什么即使我在自定义对象中定义了一个 equals 方法,也没有删除重复项?
代码 :
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
class CustomType {
private String data1;
public CustomType(String data1) { this.data1 = data1; }
public String getData1() { return data1; }
@Override
public boolean equals(Object other){
CustomType otherC = (CustomType) other;
return this.getData1().equals(otherC.getData1());
}
@Override
public String toString(){
return "[" + data1 + "]";
}
}
public class StreamDistinctTest {
public static void main(String [] args){
List<CustomType> data = Arrays.asList(
new …Run Code Online (Sandbox Code Playgroud)