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

eu.xenit.apix.data.QName Maven / Gradle / Ivy

There is a newer version: 4.1.2
Show newest version
package eu.xenit.apix.data;

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

/**
 * Represents an unique name in alfresco for properties and types.
 */
public class QName {

    private String value;

    @JsonCreator
    public QName(String s) {
        if (s == null) {
            throw new NullPointerException();
        }
        value = s;
    }

    /**
     * @return The qname.
     */
    @JsonValue
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return value;
    }

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

        QName qName = (QName) o;

        return value != null ? value.equals(qName.value) : qName.value == null;

    }

    @Override
    public int hashCode() {
        return value != null ? value.hashCode() : 0;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy