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.
  • Field Details

    • ERROR_COMPARATOR

      public static final org.forgerock.api.models.ApiError.ErrorComparator ERROR_COMPARATOR
      ApiError Comparator, which sorts by code and description.
  • Method Details

    • 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.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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 the ApiError has an id defined, the ApiError will be defined in the top-level descriptor, and a reference to that definition will be returned.
      Parameters:
      apiError - The annotation that holds the data
      descriptor - The root descriptor, for adding definitions to.
      relativeType - The type relative to which schema resources should be resolved.
      Returns:
      ApiError instance