@Nullable public ParamsGroup getParamsGroup(@NotNull final String name) { for (ParamsGroup group : myGroups) { if (name.equals(group.getId())) return group; } return null; }
@NotNull public List<String> getList() { if (myGroups.isEmpty()) { return Collections.unmodifiableList(myParameters); } final List<String> params = new ArrayList<String>(); params.addAll(myParameters); for (ParamsGroup group : myGroups) { params.addAll(group.getParameters()); } return Collections.unmodifiableList(params); }
@Override public ParametersList clone() { try { final ParametersList clone = (ParametersList) super.clone(); clone.myParameters = new ArrayList<String>(myParameters); clone.myGroups = new ArrayList<ParamsGroup>(myGroups.size() + 1); for (ParamsGroup group : myGroups) { clone.myGroups.add(group.clone()); } return clone; } catch (CloneNotSupportedException e) { LOG.error(e); return null; } }