Class CategoryAncestryHydrationResponse

java.lang.Object
com.broadleafcommerce.catalog.service.category.hydration.CategoryAncestryHydrationResponse

public final class CategoryAncestryHydrationResponse extends Object
Returned by CategoryAncestryHydrationService in response to hydration requests.
Author:
Samarth Dhruva (samarthd)
  • Constructor Details

    • CategoryAncestryHydrationResponse

      public CategoryAncestryHydrationResponse(boolean successful, @Nullable String errorMessage, @Nullable CategoryAncestorList categoryAndAncestors)
  • Method Details

    • success

      public static CategoryAncestryHydrationResponse success(@NonNull @NonNull CategoryAncestorList categoryAndAncestors)
    • error

      public static CategoryAncestryHydrationResponse error(String errorMessage)
    • isSuccessful

      public boolean isSuccessful()
      Reports whether the hydration of the ancestry was successful.
    • getErrorMessage

      @Nullable public String getErrorMessage()
      If the operation was not successful, this will contain an error message describing why.
    • getCategoryAndAncestors

      @Nullable public CategoryAncestorList getCategoryAndAncestors()
      If the operation was successful, this will contain the category itself along with all of its ancestors. The CategoryAncestorList.ancestors will be sorted starting with the direct parent and so on with the last element being the root-level ancestor.
    • 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