src/main/java/org/semgus/java/util/JsonUtils.java
@SuppressWarnings("unchecked")
    public static List<String> ensureStrings(JSONArray arr) throws DeserializationException {
        for (int i = 0; i < arr.size(); i++) {
            if (!(arr.get(i) instanceof String)) {
                throw getTypeError(i, "a string", arr.get(i));
            }
        }
        return (List<String>)arr;
    }
/**
     * Asserts that a JSON array contains only strings.
     *
     * @param arr The JSON array.
     * @return The array coerced to a list of strings.
     * @throws DeserializationException If {@code arr} is not an array of strings.
     */
Asserts that a JSON array contains only strings.
@param arr The JSON array.
@return The array coerced to a list of strings.
@throws DeserializationException If  arr is not an array of strings.
Asserts that a JSON array contains only strings . @param arr The JSON array . @return The array coerced to a list of strings . @throws DeserializationException If arr is not an array of strings .
@SuppressWarnings("unchecked")
    public static List<String> ensureStrings(JSONArray arr) throws DeserializationException {
        for (int i = 0; i < arr.size(); i++) {
            if (!(arr.get(i) instanceof String)) {
                throw getTypeError(i, "a string", arr.get(i));
            }
        }
        return (List<String>)arr;
    }
@ SuppressWarnings ( "unchecked" ) public static List < String > ensureStrings ( JSONArray arr ) throws DeserializationException { for ( int i = 0 ; i < arr . size ( ) ; i ++ ) { if ( ! ( arr . get ( i ) instanceof String ) ) { throw getTypeError ( i , "a string" , arr . get ( i ) ) ; } } return ( List < String > ) arr ; }
Asserts that a JSON array contains only strings.
Asserts that a JSON array contains only strings .