private static boolean isOptional(Field field) {
return field.getAnnotation(OptionalMatch.class) != null;
}
private static String makePattern(Field field, PropertyDelegate propertyDelegate) {
MatchBy matchExpression = field.getAnnotation(MatchBy.class);
if (matchExpression == null) {
return propertyDelegate.getPattern();
} else {
return matchExpression.value();
}
}