decode method

XdrChangeTrustResultCode decode (
  1. XdrDataInputStream stream
)

Implementation

static XdrChangeTrustResultCode decode(XdrDataInputStream stream) {
  int value = stream.readInt();
  switch (value) {
    case 0:
      return CHANGE_TRUST_SUCCESS;
    case -1:
      return CHANGE_TRUST_MALFORMED;
    case -2:
      return CHANGE_TRUST_NO_ISSUER;
    case -3:
      return CHANGE_TRUST_INVALID_LIMIT;
    case -4:
      return CHANGE_TRUST_LOW_RESERVE;
    case -5:
      return CHANGE_TRUST_SELF_NOT_ALLOWED;
    default:
      throw Exception("Unknown enum value: $value");
  }
}