public static ExtractFromRow convert( final ExtractFromRow extractor,
                                          final TypeFactory<?> newType ) {
        return new ExtractFromRow() {
            @Override
            public TypeFactory<?> getType() {
                return newType;
            }

            @Override
            public Object getValueInRow( RowAccessor row ) {
                Object value = extractor.getValueInRow(row);
                if (value == null) return value;
                if (value instanceof Object[]) {
                    Object[] values = (Object[])value;
                    for (int i = 0; i != values.length; ++i) {
                        values[i] = newType.create(values[i]);
                    }
                    return values;
                }
                return newType.create(extractor.getValueInRow(row));
            }

            @Override
            public String toString() {
                return "(as-string " + extractor.toString() + " )";
            }
        };
    }
public static ExtractFromRow convert ( final ExtractFromRow extractor , final TypeFactory < ? > newType ) { return new ExtractFromRow ( ) { @ Override public TypeFactory < ? > getType ( ) { return newType ; } @ Override public Object getValueInRow ( RowAccessor row ) { Object value = extractor . getValueInRow ( row ) ; if ( value == null ) return value ; if ( value instanceof Object [ ] ) { Object [ ] values = ( Object [ ] ) value ; for ( int i = 0 ; i != values . length ; ++ i ) { values [ i ] = newType . create ( values [ i ] ) ; } return values ; } return newType . create ( extractor . getValueInRow ( row ) ) ; } @ Override public String toString ( ) { return "(as-string " + extractor . toString ( ) + " )" ; } } ; }
Obtain a new {@link ExtractFromRow} instance that uses the supplied row extractor but converts the value to the supplied
type.

@param extractor the extractor that obtains a value from the row; may not be null
@param newType the factory for the desired type; may not be null
@return the converting row extractor instance; never null