decode static method

Implementation

static XdrManageOfferResultCode decode(XdrDataInputStream stream) {
  int value = stream.readInt();
  switch (value) {
    case 0:
      return MANAGE_OFFER_SUCCESS;
    case -1:
      return MANAGE_OFFER_MALFORMED;
    case -2:
      return MANAGE_OFFER_SELL_NO_TRUST;
    case -3:
      return MANAGE_OFFER_BUY_NO_TRUST;
    case -4:
      return MANAGE_OFFER_SELL_NOT_AUTHORIZED;
    case -5:
      return MANAGE_OFFER_BUY_NOT_AUTHORIZED;
    case -6:
      return MANAGE_OFFER_LINE_FULL;
    case -7:
      return MANAGE_OFFER_UNDERFUNDED;
    case -8:
      return MANAGE_OFFER_CROSS_SELF;
    case -9:
      return MANAGE_OFFER_SELL_NO_ISSUER;
    case -10:
      return MANAGE_OFFER_BUY_NO_ISSUER;
    case -11:
      return MANAGE_OFFER_NOT_FOUND;
    case -12:
      return MANAGE_OFFER_LOW_RESERVE;
    default:
      throw Exception("Unknown enum value: $value");
  }
}