cn.hyperchain.sdk.response.config.HostsResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of litesdk Show documentation
Show all versions of litesdk Show documentation
A Java client tool for Hyperchain
package cn.hyperchain.sdk.response.config;
import cn.hyperchain.sdk.response.Response;
import com.google.gson.annotations.Expose;
import java.util.Base64;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class HostsResponse extends Response {
@Expose
private Map result;
/**
* convert result to hosts.
*
* @return {@link Map}
*/
public Map getHosts() {
Map hosts = new HashMap<>();
Iterator> iterator = result.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry next = iterator.next();
hosts.put(next.getKey(), new String(Base64.getDecoder().decode(next.getValue())));
}
return hosts;
}
@Override
public String toString() {
return "HostsResponse{" +
"result=" + result +
", jsonrpc='" + jsonrpc + '\'' +
", id='" + id + '\'' +
", code=" + code +
", message='" + message + '\'' +
", namespace='" + namespace + '\'' +
'}';
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy