Class AbstractDuplicateAttributeConfiguration<T>
java.lang.Object
org.ametys.cms.duplicate.contents.attr.AbstractDuplicateAttributeConfiguration<T>
- Type Parameters:
T- The type of the attribute
- All Implemented Interfaces:
DuplicateAttributeConfiguration<T>
- Direct Known Subclasses:
BooleanDuplicateAttributeConfiguration,ContentDuplicateAttributeConfiguration,DateDuplicateAttributeConfiguration,DateTimeDuplicateAttributeConfiguration,DoubleDuplicateAttributeConfiguration,LongDuplicateAttributeConfiguration,StringDuplicateAttributeConfiguration
public abstract class AbstractDuplicateAttributeConfiguration<T>
extends Object
implements DuplicateAttributeConfiguration<T>
This abstract class represents a
DuplicateAttributeConfiguration-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractDuplicateAttributeConfiguration(Configuration configuration, String attributeType) Create a new DuplicateAttributeConfiguration -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean_computeCheckNearDuplicate(Configuration configuration) Check if this attribute should also check for near duplicatesbooleanCheck if we should check for near duplicateprotected QuerygetDuplicate(T value, boolean nearDuplicateQuery) Get the query to find duplicate of this attributesprotected abstract QuerygetDuplicateQuery(T value) Get the query to check if other contents have the same valueprotected abstract QueryGet the query to check if a field is filledprotected QuerygetNearDuplicateQuery(T value) Get the query to check if other contents have almost the same valuegetPath()Set the path of the attributeGet the query to find duplicate of this attributesgetType()Get the type of the attributeprotected booleanCheck if the value is emptyvoidSet the path of the attributevoidSet the type of the attribute
-
Field Details
-
ROLE
The component role. -
_type
The type of the attribute. -
_path
The path of the attribute. -
_checkNearDuplicate
Defines this attribute should also check for near duplicates.
-
-
Constructor Details
-
AbstractDuplicateAttributeConfiguration
public AbstractDuplicateAttributeConfiguration(Configuration configuration, String attributeType) throws ConfigurationException Create a new DuplicateAttributeConfiguration- Parameters:
configuration- the configuration used to create the DuplicateAttributeConfigurationattributeType- the attribute type id- Throws:
ConfigurationException- if the configuration is not valid.
-
-
Method Details
-
_computeCheckNearDuplicate
Check if this attribute should also check for near duplicates- Parameters:
configuration- the configuration used to create the DuplicateAttributeConfiguration- Returns:
- true if this attribute should also check for near duplicates
-
getType
Description copied from interface:DuplicateAttributeConfigurationGet the type of the attribute- Specified by:
getTypein interfaceDuplicateAttributeConfiguration<T>- Returns:
- the type of the attribute
-
setType
Description copied from interface:DuplicateAttributeConfigurationSet the type of the attribute- Specified by:
setTypein interfaceDuplicateAttributeConfiguration<T>- Parameters:
type- the type of the attribute
-
getPath
Description copied from interface:DuplicateAttributeConfigurationSet the path of the attribute- Specified by:
getPathin interfaceDuplicateAttributeConfiguration<T>- Returns:
- the path of the attribute
-
setPath
Description copied from interface:DuplicateAttributeConfigurationSet the path of the attribute- Specified by:
setPathin interfaceDuplicateAttributeConfiguration<T>- Parameters:
path- the path of the attribute
-
checkNearDuplicate
Description copied from interface:DuplicateAttributeConfigurationCheck if we should check for near duplicate- Specified by:
checkNearDuplicatein interfaceDuplicateAttributeConfiguration<T>- Returns:
- true if we should check for near duplicate
-
getExistQuery
Get the query to check if a field is filled- Returns:
- the query
-
getDuplicateQuery
Get the query to check if other contents have the same value- Parameters:
value- the value to check- Returns:
- the query
-
getNearDuplicateQuery
Get the query to check if other contents have almost the same value- Parameters:
value- the value to check- Returns:
- the query
-
getDuplicate
Get the query to find duplicate of this attributes- Parameters:
value- the value of the attributenearDuplicateQuery- true if the query should check near duplicates- Returns:
- the query to find duplicate of this attributes
-
getQuery
Description copied from interface:DuplicateAttributeConfigurationGet the query to find duplicate of this attributes- Specified by:
getQueryin interfaceDuplicateAttributeConfiguration<T>- Parameters:
value- the value of the attributenearDuplicateQuery- true if the query should check near duplicates- Returns:
- the query to find duplicate of this attributes
-
isEmpty
Check if the value is empty- Parameters:
value- the value- Returns:
- true if the value is empty
-