public int getInt(String path) {
        //The type returned from Groovy depends on the input, so we need to handle different numerical types.
        Object value = get(path);
        if (value instanceof Integer) {
            return (Integer) value;
        } else if (value instanceof Short) {
            return ((Short) value).intValue();
        } else if (value instanceof Long) {
            return ((Long) value).intValue();
        } else {
            return ObjectConverter.convertObjectTo(value, Integer.class);
        }
    }
public int getInt ( String path ) { Object value = get ( path ) ; if ( value instanceof Integer ) { return ( Integer ) value ; } else if ( value instanceof Short ) { return ( ( Short ) value ) . intValue ( ) ; } else if ( value instanceof Long ) { return ( ( Long ) value ) . intValue ( ) ; } else { return ObjectConverter . convertObjectTo ( value , Integer . class ) ; } }
Get the result of an Object path expression as an int.

@param path The Object path.
@return The int matching the Object path. A {@link java.lang.ClassCastException} will be thrown if the object
cannot be casted to the expected type.