no.difi.vefa.peppol.common.model.ServiceReference Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of peppol-common Show documentation
Show all versions of peppol-common Show documentation
Library for lookup in the PEPPOL infrastructure.
package no.difi.vefa.peppol.common.model;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
/**
* @author erlend
*/
public class ServiceReference {
private DocumentTypeIdentifier documentTypeIdentifier;
private List processIdentifiers;
public static ServiceReference of(DocumentTypeIdentifier documentTypeIdentifier, ProcessIdentifier... processIdentifiers) {
return new ServiceReference(documentTypeIdentifier, Arrays.asList(processIdentifiers));
}
public static ServiceReference of(DocumentTypeIdentifier documentTypeIdentifier, List processIdentifiers) {
return new ServiceReference(documentTypeIdentifier, processIdentifiers);
}
private ServiceReference(DocumentTypeIdentifier documentTypeIdentifier, List processIdentifiers) {
this.documentTypeIdentifier = documentTypeIdentifier;
this.processIdentifiers = processIdentifiers;
}
public DocumentTypeIdentifier getDocumentTypeIdentifier() {
return documentTypeIdentifier;
}
public List getProcessIdentifiers() {
return processIdentifiers;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ServiceReference that = (ServiceReference) o;
return Objects.equals(documentTypeIdentifier, that.documentTypeIdentifier) &&
Objects.equals(processIdentifiers, that.processIdentifiers);
}
@Override
public int hashCode() {
return Objects.hash(documentTypeIdentifier, processIdentifiers);
}
}