Class StringDuplicateAttributeConfiguration
- java.lang.Object
-
- org.ametys.cms.duplicate.contents.attr.AbstractDuplicateAttributeConfiguration<String>
-
- org.ametys.cms.duplicate.contents.attr.impl.StringDuplicateAttributeConfiguration
-
- All Implemented Interfaces:
DuplicateAttributeConfiguration<String>
public class StringDuplicateAttributeConfiguration extends AbstractDuplicateAttributeConfiguration<String>
Represents aDuplicateAttributeConfiguration
for aString
-
-
Field Summary
-
Fields inherited from class org.ametys.cms.duplicate.contents.attr.AbstractDuplicateAttributeConfiguration
_checkNearDuplicate, _path, _type, ROLE
-
-
Constructor Summary
Constructors Constructor Description StringDuplicateAttributeConfiguration(Configuration configuration, String attributeType)
Create a new StringDuplicateAttributeConfiguration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
_computeCheckNearDuplicate(Configuration configuration)
Check if this attribute should also check for near duplicatesprotected Query
getDuplicateQuery(String value)
Get the query to check if other contents have the same valueprotected Query
getExistQuery()
Get the query to check if a field is filledQuery
getNearDuplicateQuery(String value)
Get the query to check if other contents have almost the same valueprotected boolean
isEmpty(Object value)
Check if the value is empty-
Methods inherited from class org.ametys.cms.duplicate.contents.attr.AbstractDuplicateAttributeConfiguration
checkNearDuplicate, getDuplicate, getPath, getQuery, getType, setPath, setType
-
-
-
-
Constructor Detail
-
StringDuplicateAttributeConfiguration
public StringDuplicateAttributeConfiguration(Configuration configuration, String attributeType) throws ConfigurationException
Create a new StringDuplicateAttributeConfiguration- Parameters:
configuration
- the configuration used to create the DuplicateAttributeConfigurationattributeType
- the attribute type id- Throws:
ConfigurationException
- if the configuration is not valid.
-
-
Method Detail
-
getExistQuery
protected Query getExistQuery()
Description copied from class:AbstractDuplicateAttributeConfiguration
Get the query to check if a field is filled- Specified by:
getExistQuery
in classAbstractDuplicateAttributeConfiguration<String>
- Returns:
- the query
-
getDuplicateQuery
protected Query getDuplicateQuery(String value)
Description copied from class:AbstractDuplicateAttributeConfiguration
Get the query to check if other contents have the same value- Specified by:
getDuplicateQuery
in classAbstractDuplicateAttributeConfiguration<String>
- Parameters:
value
- the value to check- Returns:
- the query
-
getNearDuplicateQuery
public Query getNearDuplicateQuery(String value)
Description copied from class:AbstractDuplicateAttributeConfiguration
Get the query to check if other contents have almost the same value- Overrides:
getNearDuplicateQuery
in classAbstractDuplicateAttributeConfiguration<String>
- Parameters:
value
- the value to check- Returns:
- the query
-
_computeCheckNearDuplicate
protected boolean _computeCheckNearDuplicate(Configuration configuration)
Description copied from class:AbstractDuplicateAttributeConfiguration
Check if this attribute should also check for near duplicates- Overrides:
_computeCheckNearDuplicate
in classAbstractDuplicateAttributeConfiguration<String>
- Parameters:
configuration
- the configuration used to create the DuplicateAttributeConfiguration- Returns:
- true if this attribute should also check for near duplicates
-
isEmpty
protected boolean isEmpty(Object value)
Description copied from class:AbstractDuplicateAttributeConfiguration
Check if the value is empty- Overrides:
isEmpty
in classAbstractDuplicateAttributeConfiguration<String>
- Parameters:
value
- the value- Returns:
- true if the value is empty
-
-