예제 #1
0
  public WCHectare getHectareById(int id) {

    resource =
        client.resource(
            WebServicePaths.getHectareById + UserConstants.getSessionUser().getFarm() + id);
    WebServiceHectare webServiceHectare = resource.get(WebServiceHectare.class);

    return (WCHectare) ObjectConverter.convertWebObjectToNormalObject(webServiceHectare);
  }
예제 #2
0
  public List<WCHectare> getAllHectares() {

    List<WCHectare> hectares = new ArrayList<WCHectare>();

    resource =
        client.resource(WebServicePaths.getHectares + UserConstants.getSessionUser().getFarm());
    WebServiceHectare[] hectareArray = resource.get(WebServiceHectare[].class);

    List<WebServiceHectare> hectareList = Arrays.asList(hectareArray);

    WCHectare hectare = new WCHectare();
    for (WebServiceHectare webServiceHectare : hectareList) {

      hectare = (WCHectare) ObjectConverter.convertWebObjectToNormalObject(webServiceHectare);
      hectares.add(hectare);
    }

    return hectares;
  }