Package com.ultikits.ultitools.utils
Class CredentialStore.ReadResult
java.lang.Object
com.ultikits.ultitools.utils.CredentialStore.ReadResult
- Enclosing class:
CredentialStore
The outcome of a
CredentialStore.read() call. Deliberately has no isEmpty()-style method
that a caller could use to conflate isAbsent() with isParseFailure() --
the two are structurally distinct outcomes and must be checked separately.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateReadResult(CredentialStore.ReadResult.Outcome outcome, Map<String, Object> data) -
Method Summary
Modifier and TypeMethodDescriptionprivate static CredentialStore.ReadResultabsent()data()The parsed content.booleanisAbsent()booleanisParsed()booleanprivate static CredentialStore.ReadResultprivate static CredentialStore.ReadResult
-
Field Details
-
outcome
-
data
-
-
Constructor Details
-
ReadResult
-
-
Method Details
-
absent
-
parsed
-
parseFailure
-
isAbsent
public boolean isAbsent()- Returns:
trueifdata.jsondid not exist at read time
-
isParsed
public boolean isParsed()- Returns:
trueifdata.jsonexisted and parsed successfully
-
isParseFailure
public boolean isParseFailure()- Returns:
trueifdata.jsonexisted but did not parse as valid JSON -- a torn file, distinguishable fromisAbsent()
-
data
The parsed content. An absent file yields an empty map, by definition.- Returns:
- the parsed document
- Throws:
IllegalStateException- if this resultisParseFailure()-- there is no empty-map fallback for a torn file; the caller must check the outcome first
-