package info.FrostFS.sdk.jdo; import info.FrostFS.sdk.Base58; public class ContainerId { public String value; public ContainerId(String value) { this.value = value; } public static ContainerId fromHash(byte[] hash) { if (hash.length != Constants.SHA256_HASH_LENGTH) { throw new IllegalArgumentException("ContainerID must be a sha256 hash."); } return new ContainerId(Base58.encode(hash)); } public String getValue() { return value; } public void setValue(String value) { this.value = value; } @Override public String toString() { return value; } public byte[] toHash() { return Base58.decode(value); } }