Class JsonDetectionResult


  • public class JsonDetectionResult
    extends Object
    Represents the result of attempting to detect if content is JSON. Provides enough information to determine whether format detection
    • Constructor Detail

      • JsonDetectionResult

        public JsonDetectionResult()
    • Method Detail

      • hasDetectionResult

        public boolean hasDetectionResult()
        Whether or not format detection succeeded in determining a positive or negative result.
        Returns:
        true if the format detection produced a result, otherwise false
      • hasError

        public boolean hasError()
        Whether or not format detection caught an exception during the detection process.
        Returns:
        true if there was an exception thrown during the detection process, otherwise false
      • isJson

        public boolean isJson()
        Is the content JSON? This should only be called if hasDetectionResult() returns true (or if you don't care whether an error occurred during detection).
        Returns:
        true only if detection succeeded and the format was detected as JSON, otherwise false
      • getErrorOrNull

        @Nullable
        public Exception getErrorOrNull()
        Did an error occur during the detection process.
        Returns:
        true if there was exception thrown during the detection process