@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof SourceStorageImpl)) { return false; } final SourceStorageImpl that = (SourceStorageImpl) obj; return Objects.equals(id, that.id) && Objects.equals(type, that.type) && Objects.equals(location, that.location) && getParameters().equals(that.getParameters()); }
public ProjectConfigImpl(ProjectConfig projectConfig) { name = projectConfig.getName(); path = projectConfig.getPath(); description = projectConfig.getDescription(); type = projectConfig.getType(); mixins = new ArrayList<>(projectConfig.getMixins()); attributes = projectConfig .getAttributes() .entrySet() .stream() .collect(toMap(Map.Entry::getKey, e -> new ArrayList<>(e.getValue()))); SourceStorage sourceStorage = projectConfig.getSource(); if (sourceStorage != null) { source = new SourceStorageImpl( sourceStorage.getType(), sourceStorage.getLocation(), sourceStorage.getParameters()); } if (projectConfig.getProblems() != null) { problems = projectConfig .getProblems() .stream() .map(problem -> new ProjectProblemImpl(problem.getCode(), problem.getMessage())) .collect(Collectors.toList()); } else { problems = Collections.emptyList(); } }
@Override public int hashCode() { int hash = 7; hash = 31 * hash + Objects.hashCode(id); hash = 31 * hash + Objects.hashCode(type); hash = 31 * hash + Objects.hashCode(location); hash = 31 * hash + getParameters().hashCode(); return hash; }