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

com.verisec.frejaeid.client.beans.general.OrganisationIdInfo Maven / Gradle / Ivy

package com.verisec.frejaeid.client.beans.general;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * Contains information regarding organisation ID and its issuer.
 */
public class OrganisationIdInfo {

    private final String identifier;
    private final Map issuerFriendlyName;
    private final String issuerCode;
    private final List additionalAttributes;

    /**
     * Creates instance of {@linkplain OrganisationIdInfo}.
     *
     * @param identifier           User's Organisation ID. It cannot be {@code null} or empty.
     * @param issuerFriendlyName   Friendly name of the organisation which issued the user's Organisation ID
     *                             in Swedish and English. It cannot be {@code null} or empty.
     * @param issuerCode           Unique identifier of the organisation which issued the user's Organisation ID. It
     *                             can be {@code null} or empty.
     * @param additionalAttributes additional attributes related to the identifier.
     *                             It can be {@code null} or empty.
     */
    @JsonCreator
    public OrganisationIdInfo(@JsonProperty("identifier") String identifier,
                              @JsonProperty("issuerFriendlyName") Map issuerFriendlyName,
                              @JsonProperty("issuerCode") String issuerCode,
                              @JsonProperty("additionalAttributes") List additionalAttributes) {
        this.identifier = identifier;
        this.issuerFriendlyName = issuerFriendlyName;
        this.issuerCode = issuerCode;
        this.additionalAttributes = additionalAttributes;
    }

    public String getIdentifier() {
        return identifier;
    }

    public Map getIssuerFriendlyName() {
        return issuerFriendlyName;
    }

    public String getIssuerCode() {
        return issuerCode;
    }

    public List getAdditionalAttributes() {
        return additionalAttributes;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrganisationIdInfo that = (OrganisationIdInfo) o;
        return Objects.equals(identifier, that.identifier)
                && Objects.equals(issuerFriendlyName, that.issuerFriendlyName)
                && Objects.equals(issuerCode, that.issuerCode)
                && Objects.equals(additionalAttributes, that.additionalAttributes);
    }

    @Override
    public int hashCode() {
        return Objects.hash(identifier, issuerFriendlyName, issuerCode, additionalAttributes);
    }

    @Override
    public String toString() {
        return "OrganisationIdInfo{" +
                "identifier='" + identifier + '\'' +
                ", issuerFriendlyName=" + issuerFriendlyName +
                ", issuerCode='" + issuerCode + '\'' +
                ", additionalAttributes=" + additionalAttributes +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy