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
-
Constructor Summary
ConstructorDescriptionAbstractDuplicateAttributeConfiguration
(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 duplicatesboolean
Check if we should check for near duplicateprotected Query
getDuplicate
(T value, boolean nearDuplicateQuery) Get the query to find duplicate of this attributesprotected abstract Query
getDuplicateQuery
(T value) Get the query to check if other contents have the same valueprotected abstract Query
Get the query to check if a field is filledprotected Query
getNearDuplicateQuery
(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 boolean
Check if the value is emptyvoid
Set the path of the attributevoid
Set 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:DuplicateAttributeConfiguration
Get the type of the attribute- Specified by:
getType
in interfaceDuplicateAttributeConfiguration<T>
- Returns:
- the type of the attribute
-
setType
Description copied from interface:DuplicateAttributeConfiguration
Set the type of the attribute- Specified by:
setType
in interfaceDuplicateAttributeConfiguration<T>
- Parameters:
type
- the type of the attribute
-
getPath
Description copied from interface:DuplicateAttributeConfiguration
Set the path of the attribute- Specified by:
getPath
in interfaceDuplicateAttributeConfiguration<T>
- Returns:
- the path of the attribute
-
setPath
Description copied from interface:DuplicateAttributeConfiguration
Set the path of the attribute- Specified by:
setPath
in interfaceDuplicateAttributeConfiguration<T>
- Parameters:
path
- the path of the attribute
-
checkNearDuplicate
Description copied from interface:DuplicateAttributeConfiguration
Check if we should check for near duplicate- Specified by:
checkNearDuplicate
in 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:DuplicateAttributeConfiguration
Get the query to find duplicate of this attributes- Specified by:
getQuery
in 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
-