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

org.bdware.doip.audit.AuditRuleSetResponseStatus Maven / Gradle / Ivy

There is a newer version: 1.5.4
Show newest version
package org.bdware.doip.audit;

/**
 *  It defines all the response state when an audit rule is set.
 */
public enum AuditRuleSetResponseStatus {
    /**
     * The status represents the set is susscessful.
     */
    SUCCESS(0),
    /**
     * The status represents the set is rejected.
     */
    FAILED(1),
    /**
     * Unknown error
     */
    UNKNOWN(2);

    /**
     * The status code for a status.
     */
    int code;
    AuditRuleSetResponseStatus(int code) {
        this.code = code;
    }

    /**
     * Gets the status code for a status.
     * @param auditRuleSetResponseStatus The target status.
     * @return The status code for the target status
     */
    int getCode(AuditRuleSetResponseStatus auditRuleSetResponseStatus) {
        for (AuditRuleSetResponseStatus item : AuditRuleSetResponseStatus.values()) {
            if (item == auditRuleSetResponseStatus) {
                return item.code;
            }
        }
        return UNKNOWN.code;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy