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

org.inigma.shared.webapp.Rejection Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package org.inigma.shared.webapp;

import com.google.common.base.Objects;
import com.google.common.base.Preconditions;

public class Rejection {
    private final String code;
    private String message;

    public Rejection(String code, String message) {
        Preconditions.checkNotNull(code);
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Rejection)) return false;

        Rejection that = (Rejection) o;

        if (!code.equals(that.code)) return false;

        return true;
    }

    public final String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public int hashCode() {
        return code.hashCode();
    }

    @Override
    public String toString() {
        return Objects.toStringHelper(this)
                .add("code", code)
                .add("message", message)
                .toString();
    }

    void setMessage(String message) {
        this.message = message;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy