コード例 #1
0
  @Override
  public CompostableWasteCollectionRequest clone() {
    CompostableWasteCollectionRequest clone =
        new CompostableWasteCollectionRequest(
            getRequestData().clone(), compostableWasteCollectionRequestData.clone());
    Map<String, Object> stepState;

    stepState = new HashMap<String, Object>(4);
    stepState.put("state", "uncomplete");
    stepState.put("required", true);
    stepState.put("errorMsg", null);
    stepState.put("invalidFields", new ArrayList<String>());
    clone.getStepStates().put("waste", stepState);

    stepState = new HashMap<String, Object>(4);
    stepState.put("state", "unavailable");
    stepState.put("required", false);
    stepState.put("errorMsg", null);
    stepState.put("invalidFields", new ArrayList<String>());
    clone.getStepStates().put("document", stepState);

    stepState = new HashMap<String, Object>(4);
    stepState.put("state", "unavailable");
    stepState.put("required", true);
    stepState.put("errorMsg", null);
    stepState.put("invalidFields", new ArrayList<String>());
    clone.getStepStates().put("validation", stepState);

    return clone;
  }
コード例 #2
0
  public static CompostableWasteCollectionRequest xmlToModel(
      CompostableWasteCollectionRequestDocument compostableWasteCollectionRequestDoc) {
    CompostableWasteCollectionRequestDocument.CompostableWasteCollectionRequest
        compostableWasteCollectionRequestXml =
            compostableWasteCollectionRequestDoc.getCompostableWasteCollectionRequest();
    Calendar calendar = Calendar.getInstance();
    LocalTime localTime = new LocalTime();
    List list = new ArrayList();
    CompostableWasteCollectionRequest compostableWasteCollectionRequest =
        new CompostableWasteCollectionRequest();
    compostableWasteCollectionRequest.fillCommonModelInfo(
        compostableWasteCollectionRequest, compostableWasteCollectionRequestXml);

    if (compostableWasteCollectionRequestXml.getCollectionAddress() != null)
      compostableWasteCollectionRequest.setCollectionAddress(
          Address.xmlToModel(compostableWasteCollectionRequestXml.getCollectionAddress()));

    List<fr.cg95.cvq.business.request.LocalReferentialData> compostableWasteTypeList =
        new ArrayList<fr.cg95.cvq.business.request.LocalReferentialData>(
            compostableWasteCollectionRequestXml.sizeOfCompostableWasteTypeArray());
    for (LocalReferentialDataType object :
        compostableWasteCollectionRequestXml.getCompostableWasteTypeArray()) {
      compostableWasteTypeList.add(
          fr.cg95.cvq.business.request.LocalReferentialData.xmlToModel(object));
    }
    compostableWasteCollectionRequest.setCompostableWasteType(compostableWasteTypeList);

    compostableWasteCollectionRequest.setOtherWaste(
        compostableWasteCollectionRequestXml.getOtherWaste());

    return compostableWasteCollectionRequest;
  }