Package ro.sync.ecss.conditions
Class ProfileConditionInfoPO
- java.lang.Object
-
- ro.sync.ecss.conditions.ProfileConditionInfoPO
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,PersistentObject
@API(type=EXTENDABLE, src=PRIVATE) public class ProfileConditionInfoPO extends java.lang.Object implements PersistentObject
Contains information about a condition processing attribute name and possible values.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ProfileConditionInfoPO()
Constructor.ProfileConditionInfoPO(java.lang.String attributeName, java.lang.String attributeRenderName, boolean allowsMultipleValues, ProfileConditionValuePO[] allowedValues, java.lang.String valuesSeparator, java.lang.String documentTypePattern)
Constructor used only by default values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkValid()
Check if object is valid to be used.ProfileConditionInfoPO
clone()
Forces all the persistent objects to be cloneable.boolean
containsGroup(java.lang.String attribute, java.lang.String value)
Check if a specific group with the given attribute and value is allowed.boolean
containsValue(java.lang.String value)
Check if a specific value is allowed.static ProfileConditionInfoPO
createDefaultProfileConditionInfoPO(java.lang.String attributeName, java.lang.String attributeRenderName, boolean allowsMultipleValues, java.lang.String[] allowedValues, java.lang.String valuesSeparator, java.lang.String documentTypePattern)
Creates a default Profile Condition Info.boolean
equals(java.lang.Object obj)
ProfileConditionValuePO[]
getAllowedValues()
java.lang.String
getAllowedValuesDescription()
java.lang.String
getAttributeName()
java.lang.String
getAttributeRenderName()
java.lang.String
getDocumentTypePattern()
java.lang.String[]
getNotPersistentFieldNames()
java.lang.String
getRenderValueName(java.lang.String groupAttribute, java.lang.String value)
Get the render name for the given value.java.lang.String
getValuesSeparator()
int
hashCode()
boolean
isAllowsMultipleValues()
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(java.lang.String attributeRenderName)
Set the attribute render name.java.lang.String
toString()
-
-
-
Constructor Detail
-
ProfileConditionInfoPO
public ProfileConditionInfoPO()
Constructor.
-
ProfileConditionInfoPO
public ProfileConditionInfoPO(java.lang.String attributeName, java.lang.String attributeRenderName, boolean allowsMultipleValues, ProfileConditionValuePO[] allowedValues, java.lang.String valuesSeparator, java.lang.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 Detail
-
createDefaultProfileConditionInfoPO
public static ProfileConditionInfoPO createDefaultProfileConditionInfoPO(java.lang.String attributeName, java.lang.String attributeRenderName, boolean allowsMultipleValues, java.lang.String[] allowedValues, java.lang.String valuesSeparator, java.lang.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
public void setAttributeRenderName(java.lang.String attributeRenderName)
Set the attribute render name.- Parameters:
attributeRenderName
- The attribute Render Name.
-
getAttributeName
public java.lang.String getAttributeName()
- Returns:
- Returns the attribute name.
-
getAttributeRenderName
public java.lang.String getAttributeRenderName()
- Returns:
- Returns the attributeRenderName.
-
isAllowsMultipleValues
public boolean isAllowsMultipleValues()
- Returns:
- Returns
true
if multiple values are allowed for this attribute
-
getAllowedValues
public ProfileConditionValuePO[] getAllowedValues()
- Returns:
- Returns the allowed values for this attribute.
-
getValuesSeparator
public java.lang.String getValuesSeparator()
- Returns:
- Returns the conditional values separator.
-
getDocumentTypePattern
public java.lang.String getDocumentTypePattern()
- Returns:
- Returns the document type pattern.
If specified, the condition will be used only for the document types that match it.
-
containsValue
public boolean containsValue(java.lang.String value)
Check if a specific value is allowed.- Parameters:
value
- The value to be checked.- Returns:
True
if the value is allowed
-
containsGroup
public boolean containsGroup(java.lang.String attribute, java.lang.String value)
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
public java.lang.String getAllowedValuesDescription()
- Returns:
- the values composed with the separator
-
checkValid
public void checkValid() throws InvalidPersistentObjException
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:
PersistentObject.checkValid()
-
getNotPersistentFieldNames
public java.lang.String[] getNotPersistentFieldNames()
- Specified by:
getNotPersistentFieldNames
in interfacePersistentObject
- Returns:
- The names of the field from this object which should not be serialized.
- See Also:
PersistentObject.getNotPersistentFieldNames()
-
clone
public ProfileConditionInfoPO clone()
Description copied from interface:PersistentObject
Forces all the persistent objects to be cloneable.- Specified by:
clone
in interfacePersistentObject
- Overrides:
clone
in classjava.lang.Object
- Returns:
- A clone of this object. The clone and the original are disjunct. They share only immutable objects, like Strings, Integers, etc.
- See Also:
Object.clone()
-
setAllowedValues
public void setAllowedValues(ProfileConditionValuePO[] allowedValues, boolean sort)
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
getRenderValueName
public java.lang.String getRenderValueName(java.lang.String groupAttribute, java.lang.String value)
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.
-
-