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

io.vertx.mqtt.messages.codes.MqttPubCompReasonCode Maven / Gradle / Ivy

There is a newer version: 5.0.0.CR1
Show newest version
package io.vertx.mqtt.messages.codes;

/**
 * Reason codes for PUBCOMP MQTT message
 */
public enum MqttPubCompReasonCode implements MqttReasonCode {
    SUCCESS((byte)0x0),
    PACKET_IDENTIFIER_NOT_FOUND((byte)0x92);

    MqttPubCompReasonCode(byte byteValue) {
        this.byteValue = byteValue;
    }

    private final byte byteValue;

    @Override
    public byte value() {
        return byteValue;
    }

    public static MqttPubCompReasonCode valueOf(byte b) {
        if(b == SUCCESS.byteValue) {
            return SUCCESS;
        } else if(b == PACKET_IDENTIFIER_NOT_FOUND.byteValue) {
            return PACKET_IDENTIFIER_NOT_FOUND;
        } else {
            throw new IllegalArgumentException("unknown PUBCOMP reason code: " + b);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy