No, there is no direct way to do this, however you can create a helper method for this. e.g. (Unverified)
public Field getDeclaredFieldIngoreCase( Class<?> clazz, String fieldName ) throws NoSuchFieldException { for( Field field : clazz.getDeclaredFields() ) { if ( field.getName().equalsIgnoreCase( fieldName ) ) { return field; } } throw new NoSuchFieldException( fieldName ); }
source share