protected Object cast(Object value) {
        switch (type) {
            case STRING :
               return valueFactories.getStringFactory().create(value);
            case LONG :
                return valueFactories.getLongFactory().create(value);
            case NAME :
                return valueFactories.getNameFactory().create(value);
            case PATH :
                return valueFactories.getPathFactory().create(value);
            case DATE :
                return valueFactories.getDateFactory().create(value);
            case BOOLEAN :
                return valueFactories.getBooleanFactory().create(value);
            case URI :
                return valueFactories.getUriFactory().create(value);
            case REFERENCE :
                return valueFactories.getReferenceFactory().create(value);
            case SIMPLEREFERENCE :
                return valueFactories.getSimpleReferenceFactory().create(value);
            case WEAKREFERENCE :
                return valueFactories.getWeakReferenceFactory().create(value);
            default :
                return value;
        }
    }
protected Object cast ( Object value ) { switch ( type ) { case STRING : return valueFactories . getStringFactory ( ) . create ( value ) ; case LONG : return valueFactories . getLongFactory ( ) . create ( value ) ; case NAME : return valueFactories . getNameFactory ( ) . create ( value ) ; case PATH : return valueFactories . getPathFactory ( ) . create ( value ) ; case DATE : return valueFactories . getDateFactory ( ) . create ( value ) ; case BOOLEAN : return valueFactories . getBooleanFactory ( ) . create ( value ) ; case URI : return valueFactories . getUriFactory ( ) . create ( value ) ; case REFERENCE : return valueFactories . getReferenceFactory ( ) . create ( value ) ; case SIMPLEREFERENCE : return valueFactories . getSimpleReferenceFactory ( ) . create ( value ) ; case WEAKREFERENCE : return valueFactories . getWeakReferenceFactory ( ) . create ( value ) ; default : return value ; } }
Converts given value to the value of JCR type of this column.

@param value value to be converted.
@return converted value.