Adds a NetMask list from a string input containing a comma-separated list of (hopefully valid) NetMasks. @param input The input string @return a list of processing error messages (empty when no errors)
(String input)
| 128 | * @return a list of processing error messages (empty when no errors) |
| 129 | */ |
| 130 | public List<String> addAll(String input) { |
| 131 | |
| 132 | if (input == null || input.isEmpty()) { |
| 133 | return Collections.emptyList(); |
| 134 | } |
| 135 | |
| 136 | List<String> errMessages = new ArrayList<>(); |
| 137 | |
| 138 | for (String s : StringUtils.splitCommaSeparated(input)) { |
| 139 | try { |
| 140 | this.add(s); |
| 141 | } catch (IllegalArgumentException e) { |
| 142 | errMessages.add(s + ": " + e.getMessage()); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | return Collections.unmodifiableList(errMessages); |
| 147 | } |
| 148 | |
| 149 | /** |
| 150 | * Provides a string representation of this NetMaskSet. The format of the String is not guaranteed to remain fixed. |