Interface SkuFieldReferenceTypeUtility
- All Known Implementing Classes:
DefaultSkuFieldReferenceTypeUtility
public interface SkuFieldReferenceTypeUtility
Utility to determine the
SkuReferenceFieldType of a String value.- Author:
- Kelly Tisdell (ktisdell)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondetermineSkuFieldReferenceType(String type, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) SkuRefhas a number of fields that may be used to uniquely identify a SKU (e.g.determineSkuRefValue(SkuReferenceFieldType type, SkuRef skuRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) determineSkuRefValue(String type, SkuRef skuRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) mapValueToSkuRef(SkuReferenceFieldType type, String value, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Convenience utility method to create aSkuRefcontaining the right field value based on the providedSkuReferenceFieldType.mapValueToSkuRef(String type, String value, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Convenience utility method to create aSkuRefcontaining the right field value based on the String value provided that must resolve toSkuReferenceFieldType.
-
Method Details
-
determineSkuFieldReferenceType
@NonNull SkuReferenceFieldType determineSkuFieldReferenceType(@NonNull String type, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) SkuRefhas a number of fields that may be used to uniquely identify a SKU (e.g. upc, ean, skuContextId, etc.). When querying forSkuInventory, clients will provide aStringto indicate which field they are referencing. It is assumed that one field will be referenced in any single call.- Parameters:
type-context-- Returns:
- Throws:
IllegalArgumentException
-
determineSkuRefValue
@NonNull String determineSkuRefValue(@NonNull String type, @NonNull SkuRef skuRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Parameters:
type-skuRef-context-- Returns:
- Throws:
IllegalArgumentException- - if type is null, if skuRef is null, if type is invalid, or if the associated skuRef field is null
-
determineSkuRefValue
@NonNull String determineSkuRefValue(@NonNull SkuReferenceFieldType type, @NonNull SkuRef skuRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Parameters:
type-skuRef-context-- Returns:
- Throws:
IllegalArgumentException- - if type is null, if skuRef is null, or if the associated skuRef field is null
-
mapValueToSkuRef
@NonNull SkuRef mapValueToSkuRef(@NonNull SkuReferenceFieldType type, @NonNull String value, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Convenience utility method to create aSkuRefcontaining the right field value based on the providedSkuReferenceFieldType.- Parameters:
type-value-context-- Returns:
-
mapValueToSkuRef
@NonNull SkuRef mapValueToSkuRef(@NonNull String type, @NonNull String value, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Convenience utility method to create aSkuRefcontaining the right field value based on the String value provided that must resolve toSkuReferenceFieldType.- Parameters:
type-value-context-- Returns:
-