package com.github.nsnjson.decoding;

import com.fasterxml.jackson.databind.JsonNode;

import java.util.Optional;

public class Decoder {

    private static final Decoding DEFAULT_DECODING = new DefaultDecoding();

    /**
     * Decodes JSON from specified NSNJSON presentation.
     * @param presentation NSNJSON presentation of JSON
     * @return JSON
     */
    public static Optional<JsonNode> decode(JsonNode presentation) {
        return DEFAULT_DECODING.decode(presentation);
    }

    /**
     * Decodes JSON from specified NSNJSON presentation by custom decoding.
     * @param presentation NSNJSON presentation of JSON
     * @param decoding custom decoding
     * @return JSON
     */
    public static Optional<JsonNode> decode(JsonNode presentation, Decoding decoding) {
        return Optional.ofNullable(decoding).orElse(DEFAULT_DECODING).decode(presentation);
    }

}
@@ -213,287 +213,8 @@
 );%0A%0A
-    /**%0A     * Decodes JSON from specified NSNJSON presentation.%0A     * @param presentation NSNJSON presentation of JSON%0A     * @return JSON%0A     */%0A    public static Optional%3CJsonNode%3E decode(JsonNode presentation) %7B%0A        return DEFAULT_DECODING.decode(presentation);%0A    %7D%0A%0A
     

Delete method { Decoder @ decode }