Package net.pricefx.domain
Class CustomerGroup
Object
DomainObject
CustomerGroup
- All Implemented Interfaces:
GroupObject
@Embeddable
public class CustomerGroup
extends DomainObject
implements GroupObject
CustomerGroup
-
Field Summary
Fields inherited from class DomainObject
DEFAULT_MAX_PACKET_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasFilter()
Converts CustomerGroup to Filter object.asFilter
(DMDataSource customerDS) Returns resolved filter using the given DS, which should represent the Customer attributed object class.asFilter
(DMDataSource customerDS, Collection<DMDataSource> cxExtDS) Returns resolved filter using the given Customer Data Source and external Data Source, which should represent the Customer attributed object class.Deprecated.boolean
Indicates (returns true or false) whether another object is equal.static CustomerGroup
Creates CustomerGroup object from a Map object that represents CustomerGroup.static CustomerGroup
Creates CustomerGroup object from a Map object that represents CustomerGroup.
Allows you, for example, to use this object in a Datamart query with usage of the "where" clause.static CustomerGroup
fromSimpleFilter
(String customerFieldName, String customerFieldValue) Returns CustomerGroup created from a simple fieldName and fieldValue filter.Returns the customer field label when an item (not a filter statement) from the customer group picker is selected.Returns the customer field name when an item (not a filter statement) from the customer group picker is selected.Returns the customer field value when an item (not a filter statement) from the customer group picker is selected.Returns a filter criteria as a map of filters by a criteria selected from the customer group picker.protected String
Returns a filter as JSON by a criteria selected from the customer group picker.Get GroupObject as a filter including any extension valid for particular DomainObject into a custom filter Example:Get group context parameter name for the particular DomainObject Example:Get context parameter name for the particular DomainObject Example:getLabel()
Returns the customer field label when an item (not a filter statement) from the customer group picker is selected.int
hashCode()
Returns a hash code value for the given object.void
setCustomerFieldLabel
(String customerFieldLabel) Sets a field label value of the CustomerGroup object.
Example:void
setCustomerFieldName
(String customerFieldName) Sets a field name value of the CustomerGroup object.
Example:void
setCustomerFieldValue
(String customerFieldValue) Sets a field value of the CustomerGroup object.
Example:void
setCustomerFilterCriteria
(Map<String, Object> customerFilterCriteriaMap) Sets the filter criteria from a map of filters for the CustomerGroup.
Example:protected void
setCustomerFilterCriteriaJson
(String customerFilterCriteria) Sets the filter criteria from a JSON filter for the CustomerGroup.
Example:void
Sets the Customer Group input label.
Example:toString()
boolean
validate
(ValidationVisitor validationVisitor, PersistedObjectService objService) Methods inherited from class DomainObject
deepCopy, getNewMidnightDate, getNewMidnightDateTime, isMidnight, isMidnight, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonDeserialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerialize, jsonSerializedSizeOK, jsonSerializeToBytes, jsonSerializeToBytes, setToDayEnd, setToDayEnd, setToMidnight, setToMidnight, setToMidnightAsLocalDateTime, toPropertyMap
-
Constructor Details
-
CustomerGroup
public CustomerGroup()
-
-
Method Details
-
getLabel
Returns the customer field label when an item (not a filter statement) from the customer group picker is selected. The method is connected to the input field created bycreateCustomerGroupEntry
.Example:
def inputMap = input.CustomerGroup if (inputMap == null) { return } def input = CustomerGroup.fromMap(inputMap) String inputLabel = input.getLabel() return inputLabel
- Returns:
- The label value.
-
setLabel
Sets the Customer Group input label.
Example:CustomerGroup cg = api.customerGroupEntry("CustomerGroup") cg.setLabel("The new customer group label")
- Parameters:
label
- The label of the Customer Group.
-
getCustomerFieldName
Returns the customer field name when an item (not a filter statement) from the customer group picker is selected. The method is connected to the input field created bycreateCustomerGroupEntry
.Example:
def inputMap = input.CustomerGroup if (inputMap == null){ return } def input = CustomerGroup.fromMap(inputMap) String inputName = input.getCustomerFieldName() return inputName
- Returns:
- The customerFieldName value.
-
setCustomerFieldName
Sets a field name value of the CustomerGroup object.
Example:CustomerGroup customers = new CustomerGroup() customers.setCustomerFieldName("customerId")
- Parameters:
customerFieldName
- The value of the field name for the CustomerGroup object.
-
getCustomerFieldLabel
Returns the customer field label when an item (not a filter statement) from the customer group picker is selected. The method is connected to the input field created bycreateCustomerGroupEntry
.Example:
def inputMap = input.CustomerGroup if (inputMap == null){ return } def input = CustomerGroup.fromMap(inputMap) String inputLabel = input.getCustomerFieldLabel() return inputLabel
- Returns:
- The customerFieldLabel value.
-
setCustomerFieldLabel
Sets a field label value of the CustomerGroup object.
Example:CustomerGroup customers = new CustomerGroup() customers.setCustomerFieldLabel("The Customer")
- Parameters:
customerFieldLabel
- The value of the CustomerGroup object's field label.
-
getCustomerFieldValue
Returns the customer field value when an item (not a filter statement) from the customer group picker is selected. The method is connected to the input field created bycreateCustomerGroupEntry
.Example:
def inputMap = input.CustomerGroup if (inputMap == null){ return } def input = CustomerGroup.fromMap(inputMap) String inputValue = input.getCustomerFieldValue() return inputValue
- Returns:
- The customerFieldValue value.
-
setCustomerFieldValue
Sets a field value of the CustomerGroup object.
Example:CustomerGroup customers = new CustomerGroup() customers.setCustomerFieldValue("Bosch")
- Parameters:
customerFieldValue
- The value of the field for the CustomerGroup object.
-
getCustomerFilterCriteriaJson
Returns a filter as JSON by a criteria selected from the customer group picker. The method is connected to the input field created bycreateCustomerGroupEntry
.Example:
def inputMap = input.CustomerGroup if (inputMap == null){ return } def input = CustomerGroup.fromMap(inputMap) String inputFilterJson = input.getCustomerFilterCriteriaJson() return inputFilterJson
- Returns:
- The JSON formatted filter.
-
setCustomerFilterCriteriaJson
Sets the filter criteria from a JSON filter for the CustomerGroup.
Example:def inputMap = input.CustomerGroup if (inputMap == null){ return } def input = CustomerGroup.fromMap(inputMap) Map filterJson = """{ "_constructor":"AdvancedCriteria", "operator":"and", "criteria":[ { "fieldName":"attribute2", "operator":"iEquals", "value":"123456789" } ] } """ CustomerGroup newCg = new CustomerGroup() newCg.setCustomerFilterCriteriaJson(filterJson) return newCg
- Parameters:
customerFilterCriteria
- The filter criteria as a JSON representation.
-
getCustomerFilterCriteria
Returns a filter criteria as a map of filters by a criteria selected from the customer group picker. The method is connected to the input field created bycreateCustomerGroupEntry
.Example:
def inputMap = input.CustomerGroup if (inputMap == null){ return } def input = CustomerGroup.fromMap(inputMap) String inputFilterJson = input.getCustomerFilterCriteria() return inputFilterJson
- Returns:
- The map of filters (deserialized JSON).
-
setCustomerFilterCriteria
Sets the filter criteria from a map of filters for the CustomerGroup.
Example:def inputMap = input.CustomerGroup if (inputMap == null){ return } def input = CustomerGroup.fromMap(inputMap) Map filterJson = [_constructor: "AdvancedCriteria", operator : "and", criteria : [ [ fieldName : "attribute1", operator : "equals", value : "EA", _constructor: "AdvancedCriteria" ] ] ] CustomerGroup newCg = new CustomerGroup() newCg.setCustomerFilterCriteria(filterJson) return newCg
- Parameters:
customerFilterCriteriaMap
- The filter criteria as a map.
-
asFilter
Converts CustomerGroup to Filter object. Creates Filter from instance properties customerFieldName and customerFieldValue, or from customerCriteria. Can return null.Example:
def customerGroupMap = input.CustomerGroup if (customerGroupMap == null){ return } def customers = api.find("P", (input.CustomerGroup as CustomerGroup)?.asFilter()) return customers
- Returns:
- The filter object.
-
asFilterWithCXSubQuery
Deprecated.Directly useasFilter()
Converts CustomerGroup into a filter including converting any CX searchable items into a custom filter. Not intended for PA.Example:
def customerGroup = input.CustomerGroup CustomerGroup cg = CustomerGroup.fromMap(input.Entry) def customers = api.find("C", cg.asFilterWithCXSubQuery())
- Returns:
- The filter object.
-
asFilter
Returns resolved filter using the given DS, which should represent the Customer attributed object class.- Parameters:
customerDS
-- Returns:
- The filter object.
- Throws:
DMFieldNotFoundException
-
asFilter
public Filter asFilter(DMDataSource customerDS, Collection<DMDataSource> cxExtDS) throws DMFieldNotFoundException Returns resolved filter using the given Customer Data Source and external Data Source, which should represent the Customer attributed object class.- Parameters:
customerDS
- Customer Data Source. Must not be null.cxExtDS
- External Data Source.- Returns:
- The filter object.
- Throws:
DMFieldNotFoundException
-
fromMap
Creates CustomerGroup object from a Map object that represents CustomerGroup.
Allows you, for example, to use this object in a Datamart query with usage of the "where" clause.Example:
def cgInput = api.customerGroupEntry("Entry") CustomerGroup cg = CustomerGroup.fromMap(cgInput)
- Parameters:
map
- The representation of CustomerGroup as a Map.- Returns:
- The CustomerGroup object.
-
fromMap
Creates CustomerGroup object from a Map object that represents CustomerGroup.- Parameters:
mapper
- The JSON object mapper.map
- The representation of CustomerGroup as a Map.- Returns:
- The CustomerGroup object.
-
fromSimpleFilter
Returns CustomerGroup created from a simple fieldName and fieldValue filter.Example:
CustomerGroup customerGroup = CustomerGroup.fromSimpleFilter('customerId', "Bosch-123")
- Parameters:
customerFieldName
- The name of the field from the Customer Master table used in the simple filter.customerFieldValue
- The value of the field from the Customer Master table used in the simple filter.- Returns:
- The CustomerGroup object.
-
toString
-
equals
Indicates (returns true or false) whether another object is equal.Example:
CustomerGroup customersGroup1 = new CustomerGroup() CustomerGroup customersGroup2 = new CustomerGroup() customersGroup1.equals(customersGroup2)
-
hashCode
public int hashCode()Returns a hash code value for the given object.Example:
CustomerGroup customersGroup1 = new CustomerGroup() customersGroup1.hashCode()
-
validate
public boolean validate(ValidationVisitor validationVisitor, PersistedObjectService objService) -
getDomainFilter
Description copied from interface:net.pricefx.domain.GroupObject
Get GroupObject as a filter including any extension valid for particular DomainObject into a custom filter Example:def customerGroup = api.customerGroupEntry('Select customers:') def domainFilter = customerGroup.getDomainFilter() def customers = api.find('C', domainFilter)
- Specified by:
getDomainFilter
in interfaceGroupObject
- Returns:
- The filter object.
-
getDomainTableName
Description copied from interface:net.pricefx.domain.GroupObject
Get context parameter name for the particular DomainObject Example:def customerGroup = api.customerGroupEntry('Select customers:') def domainTableName = customerGroup.getDomainTableName() api.trace('domain table', domainTableName) // == 'Customer'
- Specified by:
getDomainTableName
in interfaceGroupObject
- Returns:
- The domain object name
-
getDomainObjectType
Description copied from interface:net.pricefx.domain.GroupObject
Get group context parameter name for the particular DomainObject Example:def customerGroup = api.customerGroupEntry('Select customers:') def domainObjectType = customerGroup.getDomainObjectType() api.trace('domain type', domainObjectType) // == 'CustomerGroup'
- Specified by:
getDomainObjectType
in interfaceGroupObject
- Returns:
- The domain object type name
-
asFilter()