public PatternValidator(String name, java.util.regex.Pattern pattern){ Args.notEmpty(name,"name"); Args.notNull(pattern,"pattern"); this.name = name; this.pattern = pattern; this.errorCode = "invalid" + Strings.upperFirst(name); }
/** * Returns the description or summary if the description is empty. */ default String descOrSummary() { return Strings.isEmpty(getDescription()) ? getSummary() : getDescription(); }
public FieldMappingBuilder trySetFieldName(String fieldName){ if(Strings.isEmpty(this.fieldName)){ this.fieldName = fieldName; } return this; }
public SimpleProperty(Class<T> type, T value) { Args.notNull(type); this.type = type; this.complex = Types.getTypeInfo(type, null).isComplexType();; this.value = value; }
public boolean test(T object) { return Strings.equalsIgnoreCase(object.getName(),name); } };
@SuppressWarnings("unchecked") public boolean convertFrom(Object value, Class<?> targetType, Class<?> genericType, Out<Object> out, ConvertContext context) throws Throwable { Enum<?> enumObject = Enums.valueOf((Class<Enum<?>>)targetType, value); if(null != enumObject){ out.set(enumObject); return true; } return false; }
public MapWrapper(EntityMapping mapping, Map map) { super(mapping, map); Args.notNull(map,"fields"); this.map = map; }
/** * Returns a map joiner with the same behavior as this one, except automatically substituting {@code nullText} * for any provided null keys or values. */ public MapJoiner useForNull(String nullText) { return new MapJoiner(joiner.useForNull(nullText), keyValueSeparator); } }