@Test public void testFilterMessage_EmptyMetadata() throws Exception { DiscardValuesTooLongFilter filter = new DiscardValuesTooLongFilter(36); MetadataCollection c = filter.filter(AdaptrisMessageFactory.getDefaultInstance().newMessage()); assertEquals(0, c.size()); }
@Override public MetadataCollection filter(MetadataCollection original) { MetadataCollection result = new MetadataCollection(); int maxLen = maxLength(); result.addAll(original.stream().filter(e -> e.getValue().length() <= maxLen) .collect(Collectors.toList())); return result; }
DiscardValuesTooLongFilter extends MetadataFilterImpl { @Override public MetadataCollection filter(MetadataCollection original) { MetadataCollection result = new MetadataCollection(); int maxLen = maxLength(); result.addAll(original.stream().filter(e -> e.getValue().length() <= maxLen) .collect(Collectors.toList())); return result; } }
DiscardValuesTooLongFilter extends MetadataFilterImpl { @Override public MetadataCollection filter(MetadataCollection original) { MetadataCollection result = new MetadataCollection(); int maxLen = maxLength(); result.addAll(original.stream().filter(e -> e.getValue().length() <= maxLen) .collect(Collectors.toList())); return result; } DiscardValuesTooLongFilter();  DiscardValuesTooLongFilter(Integer i); }
DiscardValuesTooLongFilter extends MetadataFilterImpl { @Override public MetadataCollection filter(MetadataCollection original) { MetadataCollection result = new MetadataCollection(); int maxLen = maxLength(); result.addAll(original.stream().filter(e -> e.getValue().length() <= maxLen) .collect(Collectors.toList())); return result; } DiscardValuesTooLongFilter();  DiscardValuesTooLongFilter(Integer i); @Override MetadataCollection filter(MetadataCollection original); Integer getMaxLengthChars(); void setMaxLengthChars(Integer bytes); }
DiscardValuesTooLongFilter extends MetadataFilterImpl { @Override public MetadataCollection filter(MetadataCollection original) { MetadataCollection result = new MetadataCollection(); int maxLen = maxLength(); result.addAll(original.stream().filter(e -> e.getValue().length() <= maxLen) .collect(Collectors.toList())); return result; } DiscardValuesTooLongFilter();  DiscardValuesTooLongFilter(Integer i); @Override MetadataCollection filter(MetadataCollection original); Integer getMaxLengthChars(); void setMaxLengthChars(Integer bytes);  }