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

com.ajjpj.asysmon.data.ACorrelationId Maven / Gradle / Ivy

There is a newer version: 1.0-pre28
Show newest version
package com.ajjpj.asysmon.data;

/**
 * @author arno
 */
public class ACorrelationId {
    private final String qualifier;
    private final String id;

    /**
     * @param qualifier represents a 'kind' of correlation ID. This allows an application to differentiate between e.g.
     *                  SOA correlation IDs vs. correlation IDs of internal asynchronous cascades vs. 'conversation' IDs
     *                  in a web application
     * @param id is the actual identifier.
     */
    public ACorrelationId(String qualifier, String id) {
        this.qualifier = qualifier;
        this.id = id;
    }

    public String getQualifier() {
        return qualifier;
    }

    public String getId() {
        return id;
    }

    @Override public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ACorrelationId that = (ACorrelationId) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (qualifier != null ? !qualifier.equals(that.qualifier) : that.qualifier != null) return false;

        return true;
    }

    @Override public int hashCode() {
        int result = qualifier != null ? qualifier.hashCode() : 0;
        result = 31 * result + (id != null ? id.hashCode() : 0);
        return result;
    }

    @Override public String toString() {
        return "ACorrelationId{" +
                "qualifier='" + qualifier + '\'' +
                ", id='" + id + '\'' +
                "} " + super.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy