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

io.everitoken.sdk.java.abi.AbiToBin Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version
package io.everitoken.sdk.java.abi;

import org.jetbrains.annotations.NotNull;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;

class AbiToBin {
    private final String action;
    private final T args;

    AbiToBin(@NotNull String action, @NotNull T args) {
        this.action = action;
        this.args = args;
    }

    public static String pack(String name, JSONObject args) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("action", name);
        jsonObject.put("args", args);

        return jsonObject.toString();
    }

    public String getAction() {
        return action;
    }

    @JSONField(ordinal = 1)
    public T getArgs() {
        return args;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy