Class FulfillmentValidationDataHolder

java.lang.Object
com.broadleafcommerce.cartoperation.service.fulfillment.validation.FulfillmentValidationDataHolder

public final class FulfillmentValidationDataHolder extends Object
Utility class that can be useful if during validation of the fulfillment additional data is required, but it shouldn't be immediately loaded. Also, if it is needed to execute validation in the loop, any additional data can be loaded once and reused when needed.
Author:
Dima Myroniuk (dmyroniuk)
  • Method Details

    • of

      public static FulfillmentValidationDataHolder of(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Creates the new state holder with the provided cart and context info
    • computeIfAbsent

      public <T> T computeIfAbsent(Class<T> returnType, String key, Function<String,Object> mappingFunction)
      This method uses the standard method Map.computeIfAbsent(Object, Function) to get the value from the map and casts it to the specified type.
      Parameters:
      key - key with which the specified value is to be associated
      mappingFunction - the mapping function to compute a value
      Returns:
      the current (existing or computed) value associated with the specified key, or null if the computed value is null
    • getCart

      public com.broadleafcommerce.cart.client.domain.Cart getCart()
      Resolved Cart for this checkout process request.
    • getContextInfo

      @Nullable public com.broadleafcommerce.data.tracking.core.context.ContextInfo getContextInfo()
      Context information around sandbox and multitenant state.
    • getAdditionalData

      public Map<String,Object> getAdditionalData()
      The map of additional data stored under some specific key.