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

org.jetlinks.coap.exception.CoapCodeException Maven / Gradle / Ivy

There is a newer version: 1.0.0-RC2
Show newest version
package org.jetlinks.coap.exception;

import org.jetlinks.coap.enums.Code;

/**
 * @author guyi
 */
public class CoapCodeException extends CoapException {

    private final Code code;

    public CoapCodeException(Code code) {
        super(code.toString().substring(1).replace("_", " "));
        this.code = code;
    }

    public CoapCodeException(Code code, Throwable throwable) {
        super(code.toString().substring(1).replace("_", " "), throwable);
        this.code = code;
    }

    public CoapCodeException(Code code, String message) {
        super(message);
        this.code = code;
    }

    /**
     * @return the code
     */
    public Code getCode() {
        return code;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy