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

com.tvd12.ezymq.mosquitto.util.EzyMosquittoHandlerAnnotations Maven / Gradle / Ivy

The newest version!
package com.tvd12.ezymq.mosquitto.util;

import com.tvd12.ezymq.mosquitto.annotation.EzyMosquittoHandler;

public final class EzyMosquittoHandlerAnnotations {

    private EzyMosquittoHandlerAnnotations() {}

    public static String getCommand(Object requestHandler) {
        EzyMosquittoHandler anno = requestHandler
            .getClass()
            .getAnnotation(EzyMosquittoHandler.class);
        return getCommand(anno);
    }

    public static String getCommand(EzyMosquittoHandler annotation) {
        String cmd = annotation.value();
        if (cmd.isEmpty()) {
            cmd = annotation.command();
        }
        return cmd;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy