io.everitoken.sdk.java.param.PublicKeysParams Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chain-sdk Show documentation
Show all versions of chain-sdk Show documentation
Official Java SDK for everiToken public chain. https://www.everitoken.io
package io.everitoken.sdk.java.param;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import org.jetbrains.annotations.NotNull;
import io.everitoken.sdk.java.PublicKey;
public class PublicKeysParams implements ApiParams {
private List publicKeys = new ArrayList<>();
public PublicKeysParams(@NotNull String[] publicKeys) {
for (String publicKey : publicKeys) {
this.publicKeys.add(PublicKey.of(publicKey));
}
}
public PublicKeysParams(List publicKeys) {
this.publicKeys = publicKeys;
}
public static PublicKeysParams of(List publicKeys) {
return new PublicKeysParams(publicKeys);
}
@JSONField(name = "keys")
public List getPublicKeys() {
return publicKeys.stream().map(PublicKey::toString).collect(Collectors.toList());
}
@Override
public String asBody() {
return JSON.toJSONString(this);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy