Package org.kiwiproject.json
Class JsonDetectionResult
- java.lang.Object
-
- org.kiwiproject.json.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 Summary
Constructors Constructor Description JsonDetectionResult()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Exception
getErrorOrNull()
Did an error occur during the detection process.boolean
hasDetectionResult()
Whether or not format detection succeeded in determining a positive or negative result.boolean
hasError()
Whether or not format detection caught an exception during the detection process.boolean
isJson()
Is the content JSON? This should only be called ifhasDetectionResult()
returns true (or if you don't care whether an error occurred during detection).
-
-
-
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 ifhasDetectionResult()
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
-
-