io.nem.symbol.sdk.openapi.okhttp_gson.model.AccountRestrictionFlagsEnum Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of symbol-openapi-okhttp-gson-client Show documentation
Show all versions of symbol-openapi-okhttp-gson-client Show documentation
symbol-openapi-okhttp-gson-client Generated Open API client for symbol-sdk-java
/*
* Catapult REST Endpoints
* OpenAPI Specification of catapult-rest 1.1.2
*
* The version of the OpenAPI document: 0.9.4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.nem.symbol.sdk.openapi.okhttp_gson.model;
import java.util.Objects;
import java.util.Arrays;
import io.swagger.annotations.ApiModel;
import com.google.gson.annotations.SerializedName;
import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
/**
* Type of account restriction: * 0x0001 (1 decimal) - Allow only incoming transactions from a given address. * 0x0002 (2 decimal) - Allow only incoming transactions containing a given mosaic identifier. * 0x4001 (16385 decimal) - Allow only outgoing transactions to a given address. * 0x4004 (16388 decimal) - Allow only outgoing transactions with a given transaction type. * 0x8001 (32769 decimal) - Block incoming transactions from a given address. * 0x8002 (32770 decimal) - Block incoming transactions containing a given mosaic identifier. * 0xC001 (49153 decimal) - Block outgoing transactions to a given address. * 0xC004 (49156 decimal) - Block outgoing transactions with a given transaction type.
*/
@JsonAdapter(AccountRestrictionFlagsEnum.Adapter.class)
public enum AccountRestrictionFlagsEnum {
NUMBER_1(1),
NUMBER_2(2),
NUMBER_16385(16385),
NUMBER_16388(16388),
NUMBER_32769(32769),
NUMBER_32770(32770),
NUMBER_49153(49153),
NUMBER_49156(49156);
private Integer value;
AccountRestrictionFlagsEnum(Integer value) {
this.value = value;
}
public Integer getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static AccountRestrictionFlagsEnum fromValue(Integer value) {
for (AccountRestrictionFlagsEnum b : AccountRestrictionFlagsEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final AccountRestrictionFlagsEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public AccountRestrictionFlagsEnum read(final JsonReader jsonReader) throws IOException {
Integer value = jsonReader.nextInt();
return AccountRestrictionFlagsEnum.fromValue(value);
}
}
}