Class Result
- java.lang.Object
-
- org.forgerock.openig.filter.oauth2.cnf.Result
-
public final class Result extends Object
AResult
represents the result of a validation operation: either a success or a failure (with an associated description).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Promise<Result,NeverThrowsException>
asPromise()
Returns a new completed promise wrapping this result.static Result
failure(String description)
Returns aResult
representing validation failure.String
getDescription()
Returns the failure description (null
if this is a success).boolean
isFailure()
Returnstrue
if this Result is a failure,false
otherwise.boolean
isSuccess()
Returnstrue
if this Result is a success,false
otherwise.static Result
success()
Returns aResult
representing validation success.
-
-
-
Method Detail
-
success
public static Result success()
Returns aResult
representing validation success.- Returns:
- a successful result.
-
failure
public static Result failure(String description)
Returns aResult
representing validation failure.- Parameters:
description
- The description of this failure, notnull
.- Returns:
- a failed result.
-
isSuccess
public boolean isSuccess()
Returnstrue
if this Result is a success,false
otherwise.- Returns:
true
if this Result is a success,false
otherwise.
-
isFailure
public boolean isFailure()
Returnstrue
if this Result is a failure,false
otherwise.- Returns:
true
if this Result is a failure,false
otherwise.
-
getDescription
public String getDescription()
Returns the failure description (null
if this is a success).- Returns:
- the failure description (
null
if this is a success).
-
asPromise
public Promise<Result,NeverThrowsException> asPromise()
Returns a new completed promise wrapping this result.- Returns:
- a new completed promise wrapping this result.
-
-