@Test(expectedExceptions = IllegalStateException.class) public void testAsMapNullVals() throws Exception { new ProjectValidationResultSliElParam(singletonList("2"), null).asMap(); }
public Map<String, String> asMap() { if (ids == null) { return null; } if (vals == null) { throw new IllegalStateException("Values not defined for IDs."); } if (ids.size() != vals.size()) { throw new IllegalStateException(format("Size of list of IDs (%s) and corresponding list of their values (%s)" + " is not equal.", ids.size(), vals.size())); } final Map<String, String> sliElParamMap = new LinkedHashMap<>(ids.size()); for (int index = 0; index < ids.size(); index++) { sliElParamMap.put(ids.get(index), vals.get(index)); } return sliElParamMap; }
ProjectValidationResultSliElParam extends ProjectValidationResultParam { public Map<String, String> asMap() { if (ids == null) { return null; } if (vals == null) { throw new IllegalStateException("Values not defined for IDs."); } if (ids.size() != vals.size()) { throw new IllegalStateException(format("Size of list of IDs (%s) and corresponding list of their values (%s)" + " is not equal.", ids.size(), vals.size())); } final Map<String, String> sliElParamMap = new LinkedHashMap<>(ids.size()); for (int index = 0; index < ids.size(); index++) { sliElParamMap.put(ids.get(index), vals.get(index)); } return sliElParamMap; } }
ProjectValidationResultSliElParam extends ProjectValidationResultParam { public Map<String, String> asMap() { if (ids == null) { return null; } if (vals == null) { throw new IllegalStateException("Values not defined for IDs."); } if (ids.size() != vals.size()) { throw new IllegalStateException(format("Size of list of IDs (%s) and corresponding list of their values (%s)" + " is not equal.", ids.size(), vals.size())); } final Map<String, String> sliElParamMap = new LinkedHashMap<>(ids.size()); for (int index = 0; index < ids.size(); index++) { sliElParamMap.put(ids.get(index), vals.get(index)); } return sliElParamMap; } ProjectValidationResultSliElParam(final List<String> ids, final List<String> vals); }
ProjectValidationResultSliElParam extends ProjectValidationResultParam { public Map<String, String> asMap() { if (ids == null) { return null; } if (vals == null) { throw new IllegalStateException("Values not defined for IDs."); } if (ids.size() != vals.size()) { throw new IllegalStateException(format("Size of list of IDs (%s) and corresponding list of their values (%s)" + " is not equal.", ids.size(), vals.size())); } final Map<String, String> sliElParamMap = new LinkedHashMap<>(ids.size()); for (int index = 0; index < ids.size(); index++) { sliElParamMap.put(ids.get(index), vals.get(index)); } return sliElParamMap; } ProjectValidationResultSliElParam(final List<String> ids, final List<String> vals); List<String> getIds(); List<String> getVals(); Map<String, String> asMap(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); }
ProjectValidationResultSliElParam extends ProjectValidationResultParam { public Map<String, String> asMap() { if (ids == null) { return null; } if (vals == null) { throw new IllegalStateException("Values not defined for IDs."); } if (ids.size() != vals.size()) { throw new IllegalStateException(format("Size of list of IDs (%s) and corresponding list of their values (%s)" + " is not equal.", ids.size(), vals.size())); } final Map<String, String> sliElParamMap = new LinkedHashMap<>(ids.size()); for (int index = 0; index < ids.size(); index++) { sliElParamMap.put(ids.get(index), vals.get(index)); } return sliElParamMap; } ProjectValidationResultSliElParam(final List<String> ids, final List<String> vals); List<String> getIds(); List<String> getVals(); Map<String, String> asMap(); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }