/** * Checks whether a given parameter value applies to this filter. * * @param parameterValue the value to check if applies to this parameter filter * @return {@code true} if {@code parameterValue} is valid according to this filter, {@code * false} otherwise */ @Override public boolean applies(@Nullable String parameterValue) { return getMatcher(parameterValue).matches(); }
@Override public String apply(String str) throws ParameterException { if (str == null || str.length() == 0) { return getDefaultValue(); } if (getMatcher(str).matches()) { return getNormalize().apply(str); } throw new ParameterException(str + " violates filter for parameter " + getKey()); }