Package dev.cerbos.sdk
Class CheckResult
- java.lang.Object
-
- dev.cerbos.sdk.CheckResult
-
public final class CheckResult extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCheckResult.Metastatic classCheckResult.Outputs
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Boolean>getAll()Return all actions and effects in this instance.CheckResult.MetagetMeta()Return the metadata if it was included in the response.CheckResult.OutputsgetOutputs()java.util.Optional<Response.CheckResourcesResponse.ResultEntry>getRaw()java.util.List<SchemaOuterClass.ValidationError>getValidationErrors()Returns the list of validation errors if there are any.booleanhasValidationErrors()Returns true if this result has validation errors.booleanisAllowed(java.lang.String action)Returns whether the given action is allowed.
-
-
-
Method Detail
-
isAllowed
public boolean isAllowed(java.lang.String action)
Returns whether the given action is allowed.- Parameters:
action- Action to check- Returns:
- True if the action is allowed
-
getAll
public java.util.Map<java.lang.String,java.lang.Boolean> getAll()
Return all actions and effects in this instance.- Returns:
- Map of action to boolean indicating whether the action is allowed or not
-
hasValidationErrors
public boolean hasValidationErrors()
Returns true if this result has validation errors.- Returns:
- true if this result has validation errors.
-
getValidationErrors
public java.util.List<SchemaOuterClass.ValidationError> getValidationErrors()
Returns the list of validation errors if there are any.- Returns:
- List of
SchemaOuterClass.ValidationError
-
getMeta
public CheckResult.Meta getMeta()
Return the metadata if it was included in the response.- Returns:
CheckResult.Meta
-
getOutputs
public CheckResult.Outputs getOutputs()
-
getRaw
public java.util.Optional<Response.CheckResourcesResponse.ResultEntry> getRaw()
-
-