private void checkFieldType ( int field , Type ... expected ) { Type actual = getType ( field ) ; for ( Type type : expected ) { if ( actual . equals ( type ) ) { return ; } } throw new IllegalArgumentException ( format ( "Expected field %s to be a type of %s but is %s" , field , StringUtils . join ( expected , "," ) , actual ) ) ; }
Checks that the given field is one of the provided types .