예제 #1
0
파일: OkapiClient.java 프로젝트: 9cat/cgeo
 private static List<Trackable> parseTrackables(final ArrayNode trackablesJson) {
   if (trackablesJson.size() == 0) {
     return Collections.emptyList();
   }
   final List<Trackable> result = new ArrayList<>();
   for (final JsonNode trackableResponse : trackablesJson) {
     try {
       final Trackable trk = new Trackable();
       trk.setGeocode(trackableResponse.get(TRK_GEOCODE).asText());
       trk.setName(trackableResponse.get(TRK_NAME).asText());
       result.add(trk);
     } catch (final NullPointerException e) {
       Log.e("OkapiClient.parseWaypoints", e);
       // Don't overwrite internal state with possibly partial result
       return null;
     }
   }
   return result;
 }
예제 #2
0
 @Override
 @NonNull
 public String getUrl(@NonNull final Trackable trackable) {
   return getUrl(trackable.getGeocode());
 }
예제 #3
0
 @NonNull
 public static TrackableConnector getConnector(final Trackable trackable) {
   return getTrackableConnector(trackable.getGeocode());
 }