Class 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 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 attribute
        allowedValues - 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 attribute
        allowedValues - 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
      • clone

        public ProfileConditionInfoPO clone()
        Description copied from interface: PersistentObject
        Forces all the persistent objects to be cloneable.
        Specified by:
        clone in interface PersistentObject
        Overrides:
        clone in class java.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 class java.lang.Object
        See Also:
        Object.toString()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.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 be null 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.