enterprises.orbital.impl.evexmlapi.crp.AccountBalanceParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eve-xml-api Show documentation
Show all versions of eve-xml-api Show documentation
Library to interact with EVE XML API servers
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;
}
}