@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ExternalDependency)) return false; ExternalDependency that = (ExternalDependency) o; return Objects.equals(getName(), that.getName()) && Objects.equals(getDescription(), that.getDescription()) && Objects.equals(getType(), that.getType()) && Objects.equals(getSubtype(), that.getSubtype()) && Objects.equals(getCriticality(), that.getCriticality()) && Objects.equals(getExpectations(), that.getExpectations()); }
public int hashCode() { return Objects.hash(getName(), getDescription(), getType(), getSubtype(), getCriticality(), getExpectations()); }
@Override public String toString() { return "ExternalDependency{" + "name='" + getName() + '\'' + ", description='" + getDescription() + '\'' + ", type='" + getType() + '\'' + ", subtype='" + getSubtype() + '\'' + ", criticality=" + getCriticality() + ", expectations=" + getExpectations() + '}'; }
public DependencyRepresentation(final ExternalDependency dependency) { name = dependency.getName(); description = dependency.getDescription(); type = dependency.getType() + "/" + dependency.getSubtype(); criticality = dependency.getCriticality(); expectations = dependency.getExpectations(); if (dependency instanceof ServiceDependency) { final ServiceDependency serviceDependency = (ServiceDependency) dependency; url = serviceDependency.getUrl(); methods = valueOf(serviceDependency.getMethods()); mediatypes = serviceDependency.getMediaTypes(); authentication = serviceDependency.getAuthentication(); } else { @SuppressWarnings("unchecked") final List<Datasource> datasources = ((DatasourceDependency) dependency).getDatasources(); this.datasources = datasources.stream().map(Datasource::toString).collect(toList()); } }