decode static method

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;
    case -6:
      return CHANGE_TRUST_TRUST_LINE_MISSING;
    case -7:
      return CHANGE_TRUST_CANNOT_DELETE;
    case -8:
      return CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES;
    default:
      throw Exception("Unknown enum value: $value");
  }
}