Class UserRoleAncestryHydrationResponse

java.lang.Object
com.broadleafcommerce.auth.security.service.hydration.UserRoleAncestryHydrationResponse

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

    • UserRoleAncestryHydrationResponse

      public UserRoleAncestryHydrationResponse(boolean successful, @Nullable String errorMessage, @Nullable List<UserRole> roleAndAncestors)
  • Method Details

    • success

      public static UserRoleAncestryHydrationResponse success(@NonNull @NonNull List<UserRole> ancestors)
    • error

      public static UserRoleAncestryHydrationResponse 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.
    • getRoleAndAncestors

      @Nullable public List<UserRole> getRoleAndAncestors()
      If the operation was successful, this will contain the role itself along with all of its ancestors. This will be sorted starting with the role itself, followed by its 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