Skip to content

Instantly share code, notes, and snippets.

@armed
Created November 20, 2010 07:59
Show Gist options
  • Save armed/707698 to your computer and use it in GitHub Desktop.
Save armed/707698 to your computer and use it in GitHub Desktop.
public List<AddressInfo> getAddressData() throws IOException, SwException {
Object res = callReadOnlyMethod(
GET_ADDRESS_DATA, null);
Object[] aiArray = RawDataRetriever.getAddressInfoArray(res);
Preconditions.checkState(aiArray.length == 3);
Preconditions.checkState(aiArray[1] != null);
String defaultStreetName = aiArray[1].toString();
defaultStreetName = defaultStreetName.isEmpty() ? "Без улицы" : defaultStreetName;
List<AddressInfo> aiList = Lists.newArrayList();
for (Object ai : aiArray) {
aiList.add(AddressInfo.fromRawSwAddressInfo(ai));
}
return aiList;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment