@Test public void testEmptyValue() { PrismPropertyValue<String> value = new PrismPropertyValue<String>(""); value = filter.apply(value); AssertJUnit.assertEquals("", value.getValue()); }
@Override public <T extends Object> PrismPropertyValue<T> apply(PrismPropertyValue<T> propertyValue) { Validate.notNull(propertyValue, "Node must not be null."); String text = getStringValue(propertyValue); if (StringUtils.isEmpty(text)) { return propertyValue; } String newValue = Normalizer.normalize(text, Form.NFD).replaceAll( "\\p{InCombiningDiacriticalMarks}+", ""); propertyValue.setValue((T) newValue); return propertyValue; }
DiacriticsFilter extends AbstractFilter { @Override public <T extends Object> PrismPropertyValue<T> apply(PrismPropertyValue<T> propertyValue) { Validate.notNull(propertyValue, "Node must not be null."); String text = getStringValue(propertyValue); if (StringUtils.isEmpty(text)) { return propertyValue; } String newValue = Normalizer.normalize(text, Form.NFD).replaceAll( "\\p{InCombiningDiacriticalMarks}+", ""); propertyValue.setValue((T) newValue); return propertyValue; } }
DiacriticsFilter extends AbstractFilter { @Override public <T extends Object> PrismPropertyValue<T> apply(PrismPropertyValue<T> propertyValue) { Validate.notNull(propertyValue, "Node must not be null."); String text = getStringValue(propertyValue); if (StringUtils.isEmpty(text)) { return propertyValue; } String newValue = Normalizer.normalize(text, Form.NFD).replaceAll( "\\p{InCombiningDiacriticalMarks}+", ""); propertyValue.setValue((T) newValue); return propertyValue; }  }
DiacriticsFilter extends AbstractFilter { @Override public <T extends Object> PrismPropertyValue<T> apply(PrismPropertyValue<T> propertyValue) { Validate.notNull(propertyValue, "Node must not be null."); String text = getStringValue(propertyValue); if (StringUtils.isEmpty(text)) { return propertyValue; } String newValue = Normalizer.normalize(text, Form.NFD).replaceAll( "\\p{InCombiningDiacriticalMarks}+", ""); propertyValue.setValue((T) newValue); return propertyValue; }  @Override PrismPropertyValue<T> apply(PrismPropertyValue<T> propertyValue); }
DiacriticsFilter extends AbstractFilter { @Override public <T extends Object> PrismPropertyValue<T> apply(PrismPropertyValue<T> propertyValue) { Validate.notNull(propertyValue, "Node must not be null."); String text = getStringValue(propertyValue); if (StringUtils.isEmpty(text)) { return propertyValue; } String newValue = Normalizer.normalize(text, Form.NFD).replaceAll( "\\p{InCombiningDiacriticalMarks}+", ""); propertyValue.setValue((T) newValue); return propertyValue; }  @Override PrismPropertyValue<T> apply(PrismPropertyValue<T> propertyValue);  }