/** * Get property value * * @param object object * @param path in dotted notation * @return value */ public static Object idx( Object object, String path ) { String[] properties = propertyPathAsStringArray(path); return getPropertyValue(object, properties); }
@SuppressWarnings ( "unchecked" ) public static <T> T idxGeneric( Class<T> t, Object object, final String path ) { String[] properties = propertyPathAsStringArray(path); return ( T ) getPropertyValue(object, properties); }
/** * Get property value * * @param object object * @param path in dotted notation * @return value */ public static Object idx( Object object, String path ) { String[] properties = propertyPathAsStringArray(path); return getPropertyValue(object, properties); }
@SuppressWarnings ( "unchecked" ) public static <T> T idxGeneric( Class<T> t, Object object, final String path ) { String[] properties = propertyPathAsStringArray(path); return ( T ) getPropertyValue(object, properties); }
/** * Get property value * * @param object object * @param path in dotted notation * @return value at index */ public static Object atIndex(Object object, String path) { String[] properties = propertyPathAsStringArray(path); return getPropertyValue( object, properties ); }
/** * Get property value * * @param object object * @param path in dotted notation * @return value at index */ public static Object atIndex(Object object, String path) { String[] properties = propertyPathAsStringArray(path); return getPropertyValue( object, properties ); }
public static float getPropertyFloat( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toFloat(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.flt ) { return field.getFloat( object ); } else { return Conversions.toFloat( field.getValue( object ) ); } }
public static int getPropertyInt( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toInt(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject(object); FieldAccess field = fields.get(lastProperty); if ( field.type() == Typ.intgr ) { return field.getInt( object ); } else { return Conversions.toInt(field.getValue(object)); } }
public static int getPropertyInt( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toInt(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject(object); FieldAccess field = fields.get(lastProperty); if ( field.type() == Typ.intgr ) { return field.getInt( object ); } else { return Conversions.toInt(field.getValue(object)); } }
public static char getPropertyChar( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toChar(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.chr ) { return field.getChar( object ); } else { return Conversions.toChar( field.getValue( object ) ); } }
public static char getPropertyChar( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toChar(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.chr ) { return field.getChar( object ); } else { return Conversions.toChar( field.getValue( object ) ); } }
public static double getPropertyDouble( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toDouble(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.dbl ) { return field.getDouble( object ); } else { return Conversions.toDouble( field.getValue( object ) ); } }
public static float getPropertyFloat( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toFloat(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.flt ) { return field.getFloat( object ); } else { return Conversions.toFloat( field.getValue( object ) ); } }
public static short getPropertyShort( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toShort(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.shrt ) { return field.getShort( object ); } else { return Conversions.toShort( field.getValue( object ) ); } }
public static boolean getPropertyBoolean( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toBoolean(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.bln ) { return field.getBoolean( object ); } else { return Conversions.toBoolean( field.getValue( object ) ); } }
public static boolean getPropertyBoolean( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toBoolean(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.bln ) { return field.getBoolean( object ); } else { return Conversions.toBoolean( field.getValue( object ) ); } }
public static short getPropertyShort( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toShort(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.shrt ) { return field.getShort( object ); } else { return Conversions.toShort( field.getValue( object ) ); } }
public static double getPropertyDouble( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toDouble(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.dbl ) { return field.getDouble( object ); } else { return Conversions.toDouble( field.getValue( object ) ); } }
public static long getPropertyLong( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toLong(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.lng ) { return field.getLong( object ); } else { return Conversions.toLong( field.getValue( object ) ); } }
public static long getPropertyLong( final Object root, final String... properties ) { final String lastProperty = properties[ properties.length - 1 ]; if ( isDigits( lastProperty ) ) { return Conversions.toLong(getPropertyValue(root, properties)); } Object object = baseForGetProperty( root, properties ); Map<String, FieldAccess> fields = getFieldsFromObject( object ); FieldAccess field = fields.get( lastProperty ); if ( field.type() == Typ.lng ) { return field.getLong( object ); } else { return Conversions.toLong( field.getValue( object ) ); } }