if (input == null || input.size() == 0) {
return null;
}
String ip = (String)input.get(0);
Location location = lookupService.getLocation(ip);
if (location != null) {
Tuple output = tupleFactory.newTuple(6);
output.set(0, location.countryName != null ? location.countryName : EMPTY_STRING);
output.set(1, location.countryCode != null ? location.countryCode : EMPTY_STRING);
output.set(2, location.region != null ? location.region : EMPTY_STRING);