@Override public String toString() { return "ExternalDependency{" + "name='" + getName() + '\'' + ", description='" + getDescription() + '\'' + ", type='" + getType() + '\'' + ", subtype='" + getSubtype() + '\'' + ", criticality=" + getCriticality() + ", expectations=" + getExpectations() + '}'; }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof DatasourceDependency)) return false; if (!super.equals(o)) return false; DatasourceDependency that = (DatasourceDependency) o; return Objects.equals(getDatasources(), that.getDatasources()); }
@Override public String toString() { return "DatasourceDependency{" + "datasources=" + getDatasources() + "} " + super.toString(); } }
@Override public int hashCode() { return Objects.hash(super.hashCode(), getDatasources()); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ServiceDependency)) return false; if (!super.equals(o)) return false; ServiceDependency that = (ServiceDependency) o; return Objects.equals(getUrl(), that.getUrl()) && Objects.equals(getMethods(), that.getMethods()) && Objects.equals(getMediaTypes(), that.getMediaTypes()) && Objects.equals(getAuthentication(), that.getAuthentication()); }
@Override public String toString() { return "ServiceDependency{" + "url='" + getUrl() + '\'' + ", methods=" + getMethods() + ", mediaTypes=" + getMediaTypes() + ", authentication='" + getAuthentication() + '\'' + "} " + super.toString(); }
@Override public int hashCode() { return hash(super.hashCode(), getUrl(), getMethods(), getMediaTypes(), getAuthentication()); }
public int hashCode() { return Objects.hash(getName(), getDescription(), getType(), getSubtype(), getCriticality(), getExpectations()); }
@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 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()); } }