Class FulfillmentValidationDataHolder
java.lang.Object
com.broadleafcommerce.cartoperation.service.fulfillment.validation.FulfillmentValidationDataHolder
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 Summary
Modifier and TypeMethodDescription<T> T
This method uses the standard methodMap.computeIfAbsent(Object, Function)
to get the value from the map and casts it to the specified type.The map of additional data stored under some specific key.com.broadleafcommerce.cart.client.domain.Cart
getCart()
ResolvedCart
for this checkout process request.com.broadleafcommerce.data.tracking.core.context.ContextInfo
Context information around sandbox and multitenant state.of
(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates the new state holder with the provided cart and context info
-
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 methodMap.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 associatedmappingFunction
- 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()ResolvedCart
for this checkout process request. -
getContextInfo
@Nullable public com.broadleafcommerce.data.tracking.core.context.ContextInfo getContextInfo()Context information around sandbox and multitenant state. -
getAdditionalData
The map of additional data stored under some specific key.
-