Class Attribute

java.lang.Object
com.appiancorp.suiteapi.personalization.Attribute
All Implemented Interfaces:
Serializable

public class Attribute extends Object implements Serializable

This represents the Attribute object. ALL FIELDS are required.
The default attribute types supported are: TYPE_BOOLEAN, TYPE_STRING, TYPE_INTEGER, TYPE_FLOAT, TYPE_DATE, TYPE_USER, TYPE_GROUP

See Also:
  • Field Details

  • Constructor Details

    • Attribute

      public Attribute()
    • Attribute

      public Attribute(String name, Integer type)
    • Attribute

      public Attribute(String name, Integer type, Object value)
  • Method Details

    • getName

      public String getName()
      The attribute name (unique per group type, serves as the attribute handle).
      Returns:
      String
    • setName

      public void setName(String name)
      Sets the name.
      Parameters:
      name - The name to set
    • getType

      public Integer getType()
      Can be any one of the TYPE_XXX constants on this class.
      Returns:
      Integer
    • setType

      public void setType(Integer type)
      Sets the type.
      Parameters:
      type - The type to set
    • getValue

      public Object getValue()
      Returns the attribute value.
    • setValue

      public void setValue(Object value)
      Sets the value.
      Parameters:
      value - The value to set
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getAppianTypeFromAttributeType

      public static Long getAppianTypeFromAttributeType(Integer attributeType)
    • getAttributeTypeFromAppianType

      public static Integer getAttributeTypeFromAppianType(Long appianType)
    • getTypeName

      public String getTypeName()
      Returns the name of this Attribute's type. The name is just a String that can be displayed to the end-user instead of a raw integer; the name has no special meaning (it's not a key) and can change in the future.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • findAttributeIndexByName

      public static int findAttributeIndexByName(Attribute[] attributes, String name)
      Finds the index of an attribute in a list of attributes, searching by name
      Parameters:
      attributes - the list of attributes to search in
      name - the name of the attribute to search for
      Returns:
      the index of the attribute if found, -1 if not found
    • findAttributeByName

      public static Attribute findAttributeByName(Attribute[] attributes, String name)
      Finds an attribute in a list of attributes, searching by name
      Parameters:
      attributes - the list of attributes to search in
      name - the name of the attribute to search for
      Returns:
      the attribute if found, null if not found