
software.crldev.elrondspringbootstarterreactive.domain.esdt.common.TokenPropertyName Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elrond-spring-boot-starter-reactive Show documentation
Show all versions of elrond-spring-boot-starter-reactive Show documentation
A SpringBoot Starter solution designed to ensure easy and efficient integration with the Elrond Network using a Reactive API layer.
The newest version!
package software.crldev.elrondspringbootstarterreactive.domain.esdt.common;
import org.bouncycastle.util.encoders.Hex;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import static software.crldev.elrondspringbootstarterreactive.error.ErrorMessage.TOKEN_PROPERTY;
public enum TokenPropertyName {
CAN_FREEZE("canFreeze"), CAN_WIPE("canWipe"), CAN_PAUSE("canPause"), CAN_CHANGE_OWNER("canChangeOwner"), CAN_UPGRADE("canUpgrade"), CAN_ADD_SPECIAL_ROLES("canAddSpecialRoles"), CAN_TRANSFER_NFT_CREATE_ROLE("canTransferNFTCreateRole");
private static final Map BY_VALUE = new HashMap<>();
static {
for (TokenPropertyName e : values()) {
BY_VALUE.put(e.value, e);
}
}
private final String hex;
private final String value;
TokenPropertyName(String value) {
this.value = value;
this.hex = Hex.toHexString(value.getBytes());
}
public static TokenPropertyName getByValue(String value) {
return Optional.ofNullable(BY_VALUE.get(value)).orElseThrow(() -> new IllegalArgumentException(TOKEN_PROPERTY.getValue()));
}
public String getHex() {
return this.hex;
}
public String getValue() {
return this.value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy