Create a predicate to check that a field has a certain name pattern.

@param name pattern of the field name to check
@return Predicate to check that a field has a certain name pattern
555741
public static Predicate<Field> named(final String name) {
        return field -> Pattern.compile(name).matcher(field.getName()).matches();
    }
854596
public String getTextValueForPatternName(final String name) {
        Node n = this.getSingle(name);
        String text = n == null ? null : n.getText();
        return text;
    }
328830
public static PPrimitive findByName(String name) {
        switch (name) {
            case "void":
                return VOID;
            case "bool":
                return BOOL;
            case "byte":
            case "i8":
                return BYTE;
            case "i16":
                return I16;
            case "i32":
                return I32;
            case "i64":
                return I64;
            case "double":
                return DOUBLE;
            case "string":
                return STRING;
            case "binary":
                return BINARY;
        }
        return null;
    }
416847
@Override
    public Query createNamedQuery(String name)
    {
        try
        {
            return ivEm.createNamedQuery(name);
        } finally
        {
            if (!inJTATransaction())
            {
                ivEm.clear();
            }
        }
    }
755507
public Field getField(String name) {
    if (fieldMap == null) {
      return null;
    }
    return fieldMap.get(name);
  }
17601
public FieldSchema getField(String name) {
    for (FieldSchema field : fieldSchemas)
      if (field.getName().equals(name))
        return field;
    return null;
  }
437147
@Override
    public final Query createNamedQuery(String name)
    {
        checkClosed();
        checkTransactionNeeded();
        return getPersistenceDelegator().createQuery(name);
    }
719169
function (name_pattern, spec_pattern) {
            /*  step 1: match mandatory name  */
            if (typeof name_pattern === "string") {
                if (this.name() !== name_pattern)
                    return false;
            }
            else if (   typeof name_pattern === "object"
                     && name_pattern instanceof RegExp) {
                if (!(this.name().match(name_pattern)))
                    return false;
            }
            else
                throw _cs.exception("matches", "invalid name pattern");

            /*  step 2: match optional specification  */
            var spec = this.__spec;
            for (var key in spec_pattern) {
                if (!_cs.isown(spec_pattern, key))
                    continue;
                if (!_cs.isdefined(spec[key]))
                    return false;
                var value = spec_pattern[key];
                switch (typeof spec[key]) {
                    case "number":
                    case "boolean":
                        if (spec[key] !== value)
                            return false;
                        break;
                    case "string":
                        if (!(   (   typeof value === "string"
                                  && spec[key] === value)
                              || (   typeof value === "object"
                                  && value instanceof RegExp
                                  && !(spec[key].match(value)))))
                            return false;
                        break;
                }
            }
            return true;
        }
198576
public static String getFieldNameWithJavaCase(final String name)
    {
       return name==null?null:Character.toLowerCase(name.charAt(0))+name.substring(1);
    }
52737
public static Predicate<Class<?>> named(final String name) {
        return clazz -> clazz.getName().equals(name);
    }
402232
public static Predicate<Link> havingName(final String name) {
        return link -> name.equals(link.getName());
    }
701098
private static boolean matchesNameOrWildcard(String pattern, String s) {
        return "*".equals(pattern) || Objects.equal(pattern, s);
    }
101403
public static Annotation[] findAnnotations(AbstractVariableDeclaration field, Pattern namePattern) {
		List<Annotation> result = new ArrayList<Annotation>();
		if (field.annotations == null) return EMPTY_ANNOTATIONS_ARRAY;
		for (Annotation annotation : field.annotations) {
			TypeReference typeRef = annotation.type;
			if (typeRef != null && typeRef.getTypeName() != null) {
				char[][] typeName = typeRef.getTypeName();
				String suspect = new String(typeName[typeName.length - 1]);
				if (namePattern.matcher(suspect).matches()) {
					result.add(annotation);
				}
			}
		}	
		return result.toArray(EMPTY_ANNOTATIONS_ARRAY);
	}
980851
public GroupFilter names(String... names) {
        checkNotNull(names, "Name match criteria must be not a null");

        predicate = predicate.and(combine(
            GroupMetadata::getName, in(asList(names), Predicates::containsIgnoreCase)
        ));

        return this;
    }
1226023
protected boolean name_matches(String pattern) {
	pattern = pattern.toLowerCase().replaceAll("[*]{1}", ".*?");
	return name.toLowerCase().matches(pattern) || get_fully_qualified_name().toLowerCase().matches(pattern);
    }
1311949
public AlertPolicyFilter names(String... names) {
        checkNotNull(names, "Name match criteria must be not a null");

        predicate = predicate.and(combine(
            AlertPolicyMetadata::getName, in(asList(names), Predicates::containsIgnoreCase)
        ));

        return this;
    }
1342007
public JavaField getField(String name)
  {
    ArrayList<JavaField> fieldList = getFieldList();
    
    for (int i = 0; i < fieldList.size(); i++) {
      JavaField field = fieldList.get(i);

      if (field.getName().equals(name))
        return field;
    }

    return null;
  }