Package org.forgerock.api.models
Class ApiError
java.lang.Object
org.forgerock.api.models.ApiError
Class that represents the ApiError type in API descriptor.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.forgerock.api.models.ApiError.ErrorComparator
ApiError
Comparator
, which sorts by code and description. -
Method Summary
Modifier and TypeMethodDescriptionstatic ApiError.Builder
apiError()
New apiError builder.boolean
static ApiError
fromAnnotation
(ApiError apiError, ApiDescription descriptor, Class<?> relativeType) Builds an ApiError object from the data in the annotation.getCode()
Getter of the error code.Getter of the error description.Getter of the reference.Getter of the error schema.int
hashCode()
toString()
-
Field Details
-
ERROR_COMPARATOR
public static final org.forgerock.api.models.ApiError.ErrorComparator ERROR_COMPARATORApiError
Comparator
, which sorts by code and description.
-
-
Method Details
-
getCode
Getter of the error code.- Returns:
- Code
-
getDescription
Getter of the error description.- Returns:
- Description
-
getSchema
Getter of the error schema.- Returns:
- Schema
-
getReference
Getter of the reference.- Returns:
- The reference.
-
equals
-
hashCode
public int hashCode() -
toString
-
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
-