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

com.devebot.opflow.OpflowMessage Maven / Gradle / Ivy

There is a newer version: 0.3.1
Show newest version
package com.devebot.opflow;

import java.util.Map;

/**
 *
 * @author drupalex
 */
public class OpflowMessage {

    private final byte[] body;
    private final Map info;
    
    public final static OpflowMessage EMPTY = new OpflowMessage();
    public final static OpflowMessage ERROR = new OpflowMessage(null, OpflowUtil.buildMap().put("status", "failed").toMap());
    
    private OpflowMessage() {
        body = null;
        info = null;
    }
    
    public OpflowMessage(byte[] body, Map info) {
        this.body = body;
        this.info = info;
    }

    public byte[] getBody() {
        return body;
    }
    
    public String getBodyAsString() {
        if (body == null) return null;
        return OpflowUtil.getString(body);
    }

    public Map getInfo() {
        return info;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy