All Downloads are FREE. Search and download functionalities are using the official Maven repository.

enterprises.orbital.impl.evexmlapi.crp.AccountBalanceParser Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package enterprises.orbital.impl.evexmlapi.crp;

import java.io.IOException;
import java.util.Collection;
import java.util.HashSet;

import enterprises.orbital.evexmlapi.shared.IAccountBalance;
import enterprises.orbital.impl.evexmlapi.AbstractAPIRequestAdapter;
import enterprises.orbital.impl.evexmlapi.ApiConnector;
import enterprises.orbital.impl.evexmlapi.ApiEndpoint;
import enterprises.orbital.impl.evexmlapi.shared.AbstractAccountBalanceParser;
import enterprises.orbital.impl.evexmlapi.shared.AccountBalanceResponse;

public class AccountBalanceParser extends AbstractAccountBalanceParser> {
  public AccountBalanceParser(ApiConnector connector) {
    super(connector, ApiEndpoint.CRP_ACCOUNT_BALANCE_V2);
  }

  @Override
  public Collection retrieveResponse(AbstractAPIRequestAdapter adapter) throws IOException {
    AccountBalanceResponse response = getResponse(adapter.getAuth());
    adapter.setFromLastResponse(response);
    if (adapter.isError()) return null;
    assert !response.getAccountBalances().isEmpty();
    Collection result = new HashSet();
    result.addAll(response.getAccountBalances());
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy