Package ro.sync.ecss.conditions
Class ProfileConditionInfoPO
java.lang.Object
ro.sync.ecss.conditions.ProfileConditionInfoPO
- All Implemented Interfaces:
Serializable
,Cloneable
,PersistentObject
@API(type=EXTENDABLE,
src=PRIVATE)
public class ProfileConditionInfoPO
extends Object
implements PersistentObject
Contains information about a condition processing attribute name and possible values.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.ProfileConditionInfoPO
(String attributeName, String attributeRenderName, boolean allowsMultipleValues, ProfileConditionValuePO[] allowedValues, String valuesSeparator, String documentTypePattern) Constructor used only by default values. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Check if object is valid to be used.clone()
Forces all the persistent objects to be cloneable.boolean
containsGroup
(String attribute, String value) Check if a specific group with the given attribute and value is allowed.boolean
containsValue
(String value) Check if a specific value is allowed.static ProfileConditionInfoPO
createDefaultProfileConditionInfoPO
(String attributeName, String attributeRenderName, boolean allowsMultipleValues, String[] allowedValues, String valuesSeparator, String documentTypePattern) Creates a default Profile Condition Info.boolean
String[]
getRenderValueName
(String groupAttribute, String value) Get the render name for the given value.int
hashCode()
boolean
void
setAllowedValues
(ProfileConditionValuePO[] allowedValues, boolean sort) Set the list of allowed values.void
setAllowsMultipleValues
(boolean allowsMultipleValues) true
if allows or not multiple values.void
setAttributeRenderName
(String attributeRenderName) Set the attribute render name.toString()
-
Constructor Details
-
ProfileConditionInfoPO
public ProfileConditionInfoPO()Constructor. -
ProfileConditionInfoPO
public ProfileConditionInfoPO(String attributeName, String attributeRenderName, boolean allowsMultipleValues, ProfileConditionValuePO[] allowedValues, String valuesSeparator, String documentTypePattern) Constructor used only by default values.- Parameters:
attributeName
- The conditional attribute name.attributeRenderName
- Attribute render name.allowsMultipleValues
-True
if multiple values are allowed for this attributeallowedValues
- Allowed values for this attribute.valuesSeparator
- The condition values separator.documentTypePattern
- Document type pattern. If specified, the condition will be used only for the document types that match it.
-
-
Method Details
-
createDefaultProfileConditionInfoPO
public static ProfileConditionInfoPO createDefaultProfileConditionInfoPO(String attributeName, String attributeRenderName, boolean allowsMultipleValues, String[] allowedValues, String valuesSeparator, String documentTypePattern) Creates a default Profile Condition Info.- Parameters:
attributeName
- The conditional attribute name.attributeRenderName
- Attribute render name.allowsMultipleValues
-True
if multiple values are allowed for this attributeallowedValues
- Allowed values for this attribute.valuesSeparator
- The condition values separator.documentTypePattern
- Document type pattern. If specified, the condition will be used only for the document types that match it.- Returns:
- A default Profile Condition Info.
-
setAttributeRenderName
Set the attribute render name.- Parameters:
attributeRenderName
- The attribute Render Name.
-
getAttributeName
- Returns:
- Returns the attribute name.
-
getAttributeRenderName
- Returns:
- Returns the attributeRenderName.
-
isAllowsMultipleValues
public boolean isAllowsMultipleValues()- Returns:
- Returns
true
if multiple values are allowed for this attribute
-
getAllowedValues
- Returns:
- Returns the allowed values for this attribute.
-
getValuesSeparator
- Returns:
- Returns the conditional values separator.
-
getDocumentTypePattern
- Returns:
- Returns the document type pattern.
If specified, the condition will be used only for the document types that match it.
-
containsValue
Check if a specific value is allowed.- Parameters:
value
- The value to be checked.- Returns:
True
if the value is allowed
-
containsGroup
Check if a specific group with the given attribute and value is allowed.- Parameters:
attribute
- The attribute of the group to be checked.value
- The value of the group attribute to be checked.- Returns:
True
if the group is allowed.
-
getAllowedValuesDescription
- Returns:
- the values composed with the separator
-
checkValid
Description copied from interface:PersistentObject
Check if object is valid to be used. Method is called after it is deserialized from options. If not then throw anInvalidPersistentObjException
exception.- Specified by:
checkValid
in interfacePersistentObject
- Throws:
InvalidPersistentObjException
- Thrown when instance is not valid.- See Also:
-
getNotPersistentFieldNames
- Specified by:
getNotPersistentFieldNames
in interfacePersistentObject
- Returns:
- The names of the field from this object which should not be serialized.
- See Also:
-
clone
Description copied from interface:PersistentObject
Forces all the persistent objects to be cloneable.- Specified by:
clone
in interfacePersistentObject
- Overrides:
clone
in classObject
- Returns:
- A clone of this object. The clone and the original are disjunct. They share only immutable objects, like Strings, Integers, etc.
- See Also:
-
setAllowedValues
Set the list of allowed values.- Parameters:
allowedValues
- The allowedValues to set.sort
-true
to sort the allowed values.
-
setAllowsMultipleValues
public void setAllowsMultipleValues(boolean allowsMultipleValues) true
if allows or not multiple values.- Parameters:
allowsMultipleValues
-true
if allows or not multiple values.
-
toString
-
hashCode
public int hashCode() -
equals
-
getRenderValueName
Get the render name for the given value.- Parameters:
groupAttribute
- The group attribute name. It can benull
if the value is simple.value
- The value to search.- Returns:
- The render name for the given value or
null
if wasn't found a render for value.
-