/** * Returns an specific field of some class. If definedIn is null, it searches for the field named 'name' inside the * class cls. If definedIn is different than null, tries to find the specified field name in the specified class cls * which should be defined in class definedIn (either equals cls or a one of it's superclasses) * * @param cls the class where the field is to be searched * @param name the field name * @param definedIn the superclass (or the class itself) of cls where the field was defined * @return the field itself or <code>null</code> * @since 1.4 */ public Field fieldOrNull(final Class cls, final String name, final Class definedIn) { final Map fields = buildMap(cls, definedIn != null); final Field field = (Field)fields.get(definedIn != null ? (Object)new FieldKey(name, definedIn, -1) : (Object)name); return field; }
public int compare(final Object firstObject, final Object secondObject) { final FieldKey first = (FieldKey)firstObject, second = (FieldKey)secondObject; return compare(first.getFieldName(), second.getFieldName()); }
public int compare(Object firstObject, Object secondObject) { FieldKey first = (FieldKey) firstObject, second = (FieldKey) secondObject; Class definedIn = first.getDeclaringClass(); return compare(first.getFieldName(), second.getFieldName()); }
public int compare(Object firstObject, Object secondObject) { FieldKey first = (FieldKey) firstObject, second = (FieldKey) secondObject; Class definedIn = first.getDeclaringClass(); return compare(first.getFieldName(), second.getFieldName()); }
field.setAccessible(true); final FieldKey fieldKey = new FieldKey(field.getName(), field.getDeclaringClass(), i); final Field existent = (Field)keyedByFieldName.get(field.getName()); if (existent == null
@Override public int compare(final FieldKey first, final FieldKey second) { return compare(first.getFieldName(), second.getFieldName()); }
/** * Works like {@link #field(Class, String, Class)} but returns null instead of throwing exception. */ public Field fieldOrNull(Class cls, String name, Class definedIn) { Map fields = buildMap(cls, definedIn != null); Field field = (Field)fields.get(definedIn != null ? (Object)new FieldKey( name, definedIn, 0) : (Object)name); return field; }
public int compare(Object firstObject, Object secondObject) { FieldKey first = (FieldKey)firstObject, second = (FieldKey)secondObject; return compare(first.getFieldName(), second.getFieldName()); }
/** * Returns an specific field of some class. If definedIn is null, it searches for the field named 'name' inside the * class cls. If definedIn is different than null, tries to find the specified field name in the specified class cls * which should be defined in class definedIn (either equals cls or a one of it's superclasses) * * @param cls the class where the field is to be searched * @param name the field name * @param definedIn the superclass (or the class itself) of cls where the field was defined * @return the field itself or <code>null</code> * @since 1.4 */ public Field fieldOrNull(final Class<?> cls, final String name, final Class<?> definedIn) { final Map<?, Field> fields = buildMap(cls, definedIn != null); final Field field = fields.get(definedIn != null ? (Object)new FieldKey(name, definedIn, -1) : (Object)name); return field; }
public int compare(final Object firstObject, final Object secondObject) { final FieldKey first = (FieldKey)firstObject, second = (FieldKey)secondObject; return compare(first.getFieldName(), second.getFieldName()); }
/** * Returns an specific field of some class. If definedIn is null, it searches for the field named 'name' inside the * class cls. If definedIn is different than null, tries to find the specified field name in the specified class cls * which should be defined in class definedIn (either equals cls or a one of it's superclasses) * * @param cls the class where the field is to be searched * @param name the field name * @param definedIn the superclass (or the class itself) of cls where the field was defined * @return the field itself or <code>null</code> * @since 1.4 */ public Field fieldOrNull(final Class cls, final String name, final Class definedIn) { final Map fields = buildMap(cls, definedIn != null); final Field field = (Field)fields.get(definedIn != null ? (Object)new FieldKey(name, definedIn, -1) : (Object)name); return field; }
public int compare(final Object firstObject, final Object secondObject) { final FieldKey first = (FieldKey)firstObject, second = (FieldKey)secondObject; return compare(first.getFieldName(), second.getFieldName()); }
/** * Returns an specific field of some class. If definedIn is null, it searches for the field * named 'name' inside the class cls. If definedIn is different than null, tries to find the * specified field name in the specified class cls which should be defined in class * definedIn (either equals cls or a one of it's superclasses) * * @param cls the class where the field is to be searched * @param name the field name * @param definedIn the superclass (or the class itself) of cls where the field was defined * @return the field itself or <code>null</code> * @since 1.4 */ public Field fieldOrNull(Class cls, String name, Class definedIn) { Map fields = buildMap(cls, definedIn != null); Field field = (Field)fields.get(definedIn != null ? (Object)new FieldKey(name, definedIn, -1) : (Object)name); return field; }
public int compare(Object firstObject, Object secondObject) { FieldKey first = (FieldKey)firstObject, second = (FieldKey)secondObject; return compare(first.getFieldName(), second.getFieldName()); }