Interface SkuFieldReferenceTypeUtility
-
- All Known Implementing Classes:
DefaultSkuFieldReferenceTypeUtility
public interface SkuFieldReferenceTypeUtility
Utility to determine theSkuReferenceFieldType
of aString
value.- Author:
- Kelly Tisdell (ktisdell)
- See Also:
SkuReferenceFieldType
,DefaultSkuReferenceFieldType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SkuReferenceFieldType
determineSkuFieldReferenceType(String type, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
SkuRef
has a number of fields that may be used to uniquely identify a SKU (e.g.String
determineSkuRefValue(SkuReferenceFieldType type, SkuRef skuRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
String
determineSkuRefValue(String type, SkuRef skuRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
SkuRef
mapValueToSkuRef(SkuReferenceFieldType type, String value, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Convenience utility method to create aSkuRef
containing the right field value based on the providedSkuReferenceFieldType
.SkuRef
mapValueToSkuRef(String type, String value, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
Convenience utility method to create aSkuRef
containing the right field value based on the String value provided that must resolve toSkuReferenceFieldType
.
-
-
-
Method Detail
-
determineSkuFieldReferenceType
@NonNull SkuReferenceFieldType determineSkuFieldReferenceType(@NonNull String type, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
SkuRef
has 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 aString
to 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 aSkuRef
containing 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 aSkuRef
containing the right field value based on the String value provided that must resolve toSkuReferenceFieldType
.- Parameters:
type
-value
-context
-- Returns:
-
-