コード例 #1
0
  public List<InputState> loadAllInputStates(Node node) {
    List<InputState> inputStates = Lists.newArrayList();

    for (InputStateSummaryResponse inputsResponse : getInputsFromNode(node)) {
      inputStates.add(inputStateFactory.fromSummaryResponse(inputsResponse, node));
    }

    return inputStates;
  }
コード例 #2
0
  public Map<ClusterEntity, List<InputState>> loadAllInputStatesByEntity() {
    Map<ClusterEntity, List<InputState>> result = Maps.newHashMap();
    Map<ClusterEntity, InputsResponse> inputsResponseMap = getInputsFromAllEntities();

    for (Map.Entry<ClusterEntity, InputsResponse> entry : inputsResponseMap.entrySet()) {
      List<InputState> nodeList = Lists.newArrayList();
      result.put(entry.getKey(), nodeList);

      for (InputStateSummaryResponse issr : entry.getValue().inputs) {
        nodeList.add(inputStateFactory.fromSummaryResponse(issr, entry.getKey()));
      }
    }

    return result;
  }