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

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

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

import com.alibaba.fastjson.annotation.JSONField;

import io.everitoken.sdk.java.dto.AuthorizerRef;

public class AddMetaAction extends Abi {

    @JSONField(deserialize = false, serialize = false)
    private static final String name = "addmeta";

    private final String metaKey;
    private final String metaValue;
    private final AuthorizerRef creator;

    private AddMetaAction(String key, String domain, String metaKey, String metaValue, AuthorizerRef creator) {
        super(name, key, domain);
        this.metaKey = metaKey;
        this.metaValue = metaValue;
        this.creator = creator;
    }

    public static AddMetaAction ofGroup(String key, String metaKey, String metaValue, AuthorizerRef creator) {
        return new AddMetaAction(key, ".group", metaKey, metaValue, creator);
    }

    public static AddMetaAction ofFungible(String key, String metaKey, String metaValue, AuthorizerRef creator) {
        return new AddMetaAction(key, ".fungible", metaKey, metaValue, creator);
    }

    public static AddMetaAction ofDomainToken(String key, String domain, String metaKey, String metaValue,
            AuthorizerRef creator) {
        return new AddMetaAction(key, domain, metaKey, metaValue, creator);
    }

    @Override
    @JSONField(deserialize = false, serialize = false)
    public String getKey() {
        return super.getKey();
    }

    @JSONField(name = "key")
    public String getMetaKey() {
        return metaKey;
    }

    @JSONField(name = "value")
    public String getMetaValue() {
        return metaValue;
    }

    @Override
    @JSONField(deserialize = false, serialize = false)
    public String getDomain() {
        return super.getDomain();
    }

    public String getCreator() {
        return creator.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy