/** * Creates a primitive list based on an input list and a property path * * @param inputList input list * @param propertyPath property path * @return primitive list */ public static LongList toLongList(Collection<?> inputList, String propertyPath) { if (inputList.size() == 0) { return new LongList(0); } LongList outputList = new LongList(inputList.size()); if (propertyPath.contains(".") || propertyPath.contains("[")) { String[] properties = StringScanner.splitByDelimiters(propertyPath, ".[]"); for (Object o : inputList) { outputList.add(BeanUtils.getPropertyLong(o, properties)); } } else { Map<String, FieldAccess> fields = BeanUtils.getFieldsFromObject(inputList.iterator().next()); FieldAccess fieldAccess = fields.get(propertyPath); for (Object o : inputList) { outputList.add(fieldAccess.getLong(o)); } } return outputList; }
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 ) ); } }
long lvalue = fieldAccess.getLong ( parent ); if ( includeDefault || include || lvalue != 0 ) { serializeFieldName ( fieldName, builder );
long lvalue = fieldAccess.getLong ( parent ); if ( includeDefault || include || lvalue != 0 ) { serializeFieldName ( fieldName, builder );
long lvalue = fieldAccess.getLong ( parent ); if ( lvalue != 0 ) { serializeFieldName ( fieldName, builder );
long lvalue = fieldAccess.getLong ( parent ); if ( includeDefault || include || lvalue != 0 ) { serializeFieldName ( fieldName, builder );
long lvalue = fieldAccess.getLong ( parent ); if ( lvalue != 0 ) { serializeFieldName ( fieldName, builder );
long lvalue = fieldAccess.getLong ( parent ); if ( lvalue != 0 ) { serializeFieldName ( fieldName, builder );
long lvalue = fieldAccess.getLong ( parent ); if ( lvalue != 0 ) { serializeFieldName ( fieldName, builder );
long lvalue = fieldAccess.getLong ( parent ); if ( lvalue != 0 ) { serializeFieldName ( fieldName, builder );
long lvalue = fieldAccess.getLong ( parent ); if ( lvalue != 0 ) { serializeFieldName ( fieldName, builder );