src/main/java/fr/maif/json/JsonRead.java
default JsonRead<T> orElse(JsonRead<T> fallback) {
        return JsonRead.ofRead(jsonNode -> {
            JsResult<T> jsResult = read(jsonNode);
            if (jsResult.isError()) {
                return fallback.read(jsonNode);
            } else {
                return jsResult;
            }
        }, JsonSchema.oneOf(this.jsonSchema().computeSchema(), fallback.jsonSchema().computeSchema()));
    }
/**
     * If this read doesn't succeed, switch to a fallback read.
     * @param fallback the fallback in case of failure.
     * @return the reader
     */
If this read doesn't succeed, switch to a fallback read.
@param fallback the fallback in case of failure.
@return the reader
If this read doesn ' t succeed switch to a fallback read . @param fallback the fallback in case of failure . @return the reader
default JsonRead<T> orElse(JsonRead<T> fallback) {
        return JsonRead.ofRead(jsonNode -> {
            JsResult<T> jsResult = read(jsonNode);
            if (jsResult.isError()) {
                return fallback.read(jsonNode);
            } else {
                return jsResult;
            }
        }, JsonSchema.oneOf(this.jsonSchema().computeSchema(), fallback.jsonSchema().computeSchema()));
    }
default JsonRead < T > orElse ( JsonRead < T > fallback ) { return JsonRead . ofRead ( jsonNode -> { JsResult < T > jsResult = read ( jsonNode ) ; if ( jsResult . isError ( ) ) { return fallback . read ( jsonNode ) ; } else { return jsResult ; } } , JsonSchema . oneOf ( this . jsonSchema ( ) . computeSchema ( ) , fallback . jsonSchema ( ) . computeSchema ( ) ) ) ; }
If this read doesn't succeed, switch to a fallback read.
If this read doesn ' t succeed switch to a fallback read .