All Downloads are FREE. Search and download functionalities are using the official Maven repository.

no.difi.vefa.peppol.common.model.ServiceReference Maven / Gradle / Ivy

There is a newer version: 1.1.4
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy