Package org.forgerock.api.models
Class ApiError
- java.lang.Object
-
- org.forgerock.api.models.ApiError
-
public final class ApiError extends Object
Class that represents the ApiError type in API descriptor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ApiError.Builder
Builder for the ApiError.
-
Field Summary
Fields Modifier and Type Field Description static org.forgerock.api.models.ApiError.ErrorComparator
ERROR_COMPARATOR
ApiError
Comparator
, which sorts by code and description.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ApiError.Builder
apiError()
New apiError builder.boolean
equals(Object o)
static ApiError
fromAnnotation(ApiError apiError, ApiDescription descriptor, Class<?> relativeType)
Builds an ApiError object from the data in the annotation.Integer
getCode()
Getter of the error code.LocalizableString
getDescription()
Getter of the error description.Reference
getReference()
Getter of the reference.Schema
getSchema()
Getter of the error schema.int
hashCode()
String
toString()
-
-
-
Field Detail
-
ERROR_COMPARATOR
public static final org.forgerock.api.models.ApiError.ErrorComparator ERROR_COMPARATOR
ApiError
Comparator
, which sorts by code and description.
-
-
Method Detail
-
getCode
public Integer getCode()
Getter of the error code.- Returns:
- Code
-
getDescription
public LocalizableString getDescription()
Getter of the error description.- Returns:
- Description
-
getSchema
public Schema getSchema()
Getter of the error schema.- Returns:
- Schema
-
getReference
public Reference getReference()
Getter of the reference.- Returns:
- The reference.
-
apiError
public static ApiError.Builder apiError()
New apiError builder.- Returns:
- Builder
-
fromAnnotation
public static ApiError fromAnnotation(ApiError apiError, ApiDescription descriptor, Class<?> relativeType)
Builds an ApiError object from the data in the annotation. If theApiError
has anid
defined, the ApiError will be defined in the top-leveldescriptor
, and a reference to that definition will be returned.- Parameters:
apiError
- The annotation that holds the datadescriptor
- The root descriptor, for adding definitions to.relativeType
- The type relative to which schema resources should be resolved.- Returns:
- ApiError instance
-
-