StringCriteria implements Serializable, HasIsConstrained, Clearable, Copyable<StringCriteria> { public boolean isMatch(String test) { String compareString = string; if (isCaseInsensitive() && test != null) { test = test.toUpperCase(); compareString = stringUpper; } if (!isConstrained()) { return true; } if (MatchStyle.WildEnd == matchStyle) { return test.startsWith(compareString); } if (MatchStyle.WildStartAndEnd == matchStyle) { return test.contains(compareString); } return test.equals(compareString); } StringCriteria();  StringCriteria(final String string);  StringCriteria(final String string, final MatchStyle matchStyle); @JsonCreator  StringCriteria(@JsonProperty("string") final String string,
                          @JsonProperty("stringUpper") final String stringUpper,
                          @JsonProperty("matchStyle") final MatchStyle matchStyle,
                          @JsonProperty("caseInsensitive") final boolean caseInsensitive,
                          @JsonProperty("matchNull") final Boolean matchNull); static List<StringCriteria> convertStringList(List<String> strings); @Override void clear(); String getString(); void setString(final String string); MatchStyle getMatchStyle(); void setMatchStyle(final MatchStyle matchStyle); @Override @JsonIgnore boolean isConstrained(); boolean isMatch(String test); @JsonIgnore String getMatchString(); boolean isCaseInsensitive(); void setCaseInsensitive(final boolean caseInsensitive); Boolean getMatchNull(); void setMatchNull(final Boolean matchNull); @Override void copyFrom(final StringCriteria other); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object o);  }
@Test void testIsMatch() { final StringCriteria criteria = new StringCriteria(); criteria.setString("XYZ"); assertThat(criteria.isMatch("XY")).isFalse(); assertThat(criteria.isMatch("XYZ")).isTrue(); criteria.setMatchStyle(MatchStyle.WildEnd); assertThat(criteria.isMatch("XYZ123")).isTrue(); assertThat(criteria.isMatch("XYZ")).isTrue(); assertThat(criteria.isMatch("123XYZ123")).isFalse(); criteria.setMatchStyle(MatchStyle.WildStartAndEnd); assertThat(criteria.isMatch("XYZ123")).isTrue(); assertThat(criteria.isMatch("123XYZ123")).isTrue(); }