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 classApiError.BuilderBuilder for the ApiError.
-
Field Summary
Fields Modifier and Type Field Description static org.forgerock.api.models.ApiError.ErrorComparatorERROR_COMPARATORApiErrorComparator, which sorts by code and description.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ApiError.BuilderapiError()New apiError builder.booleanequals(Object o)static ApiErrorfromAnnotation(ApiError apiError, ApiDescription descriptor, Class<?> relativeType)Builds an ApiError object from the data in the annotation.IntegergetCode()Getter of the error code.LocalizableStringgetDescription()Getter of the error description.ReferencegetReference()Getter of the reference.SchemagetSchema()Getter of the error schema.inthashCode()StringtoString()
-
-
-
Field Detail
-
ERROR_COMPARATOR
public static final org.forgerock.api.models.ApiError.ErrorComparator ERROR_COMPARATOR
ApiErrorComparator, 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 theApiErrorhas aniddefined, 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
-
-