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 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 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 ; }
Creates a primitive list based on an input list and a property path

@param inputList    input list
@param propertyPath property path
@return primitive list
Creates a primitive list based on an input list and a property path