Class UserAttribute

java.lang.Object
africa.absa.inception.security.UserAttribute
All Implemented Interfaces:
Serializable

public class UserAttribute extends Object implements Serializable
The UserAttribute class stores a user attribute as a name-value pair.
Author:
Marcus Portmann
See Also:
  • Constructor Details

    • UserAttribute

      public UserAttribute()
      Constructs a new UserAttribute.
    • UserAttribute

      public UserAttribute(String name, BigDecimal value)
      Constructs a new UserAttribute.
      Parameters:
      name - the name of the user attribute
      value - the BigDecimal value for the user attribute
    • UserAttribute

      public UserAttribute(String name, africa.absa.inception.core.util.BinaryBuffer value)
      Constructs a new UserAttribute.
      Parameters:
      name - the name of the user attribute
      value - the binary value for the user attribute
    • UserAttribute

      public UserAttribute(String name, byte[] value)
      Constructs a new UserAttribute.
      Parameters:
      name - the name of the user attribute
      value - the binary value for the user attribute
    • UserAttribute

      public UserAttribute(String name, double value)
      Constructs a new UserAttribute.
      Parameters:
      name - the name of the user attribute
      value - the double value for the user attribute
    • UserAttribute

      public UserAttribute(String name, long value)
      Constructs a new UserAttribute.
      Parameters:
      name - the name of the user attribute
      value - the long value for the user attribute
    • UserAttribute

      public UserAttribute(String name, String value)
      Constructs a new UserAttribute.
      Parameters:
      name - the name of the user attribute
      value - the String value for the user attribute
  • Method Details

    • contains

      public static boolean contains(List<UserAttribute> list, String name)
      Returns whether the list of user attributes contains a user attribute whose name matches the specified name.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      Returns:
      true if the list of user attributes contains a user attribute whose name matches the specified name or false otherwise
    • getBinaryValue

      public static byte[] getBinaryValue(List<UserAttribute> list, String name) throws UserAttributeException
      Returns the binary value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      Returns:
      the binary value for the user attribute with the specified name in the specified list
      Throws:
      UserAttributeException - if the binary value could not be retrieved for the user attribute
    • getDecimalValue

      public static BigDecimal getDecimalValue(List<UserAttribute> list, String name) throws UserAttributeException
      Returns the BigDecimal value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      Returns:
      the BigDecimal value for the user attribute with the specified name in the specified list
      Throws:
      UserAttributeException - if the decimal value could not be retrieved for the user attribute
    • getDoubleValue

      public static double getDoubleValue(List<UserAttribute> list, String name) throws UserAttributeException
      Returns the double value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      Returns:
      the double value for the user attribute with the specified name in the specified list
      Throws:
      UserAttributeException - if the double value could not be retrieved for the user attribute
    • getIntegerValue

      public static int getIntegerValue(List<UserAttribute> list, String name) throws UserAttributeException
      Returns the int value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      Returns:
      the int value for the user attribute with the specified name in the specified list
      Throws:
      UserAttributeException - if the integer value could not be retrieved for the user attribute
    • getLongValue

      public static long getLongValue(List<UserAttribute> list, String name) throws UserAttributeException
      Returns the long value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      Returns:
      the long value for the user attribute with the specified name in the specified list
      Throws:
      UserAttributeException - if the long value could not be retrieved for the user attribute
    • getStringValue

      public static String getStringValue(List<UserAttribute> list, String name) throws UserAttributeException
      Returns the String value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      Returns:
      the String value for the user attribute with the specified name in the specified list
      Throws:
      UserAttributeException - if the string value could not be retrieved for the user attribute
    • setBinaryValue

      public static void setBinaryValue(List<UserAttribute> list, String name, africa.absa.inception.core.util.BinaryBuffer value) throws UserAttributeException
      Set the binary value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      value - the binary value for the user attribute
      Throws:
      UserAttributeException - if the binary value could not be set for the user attribute
    • setBinaryValue

      public static void setBinaryValue(List<UserAttribute> list, String name, byte[] value) throws UserAttributeException
      Set the binary value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      value - the binary value for the user attribute
      Throws:
      UserAttributeException - if the binary value could not be set for the user attribute
    • setDecimalValue

      public static void setDecimalValue(List<UserAttribute> list, String name, BigDecimal value) throws UserAttributeException
      Set the BigDecimal value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      value - the BigDecimal value for the user attribute
      Throws:
      UserAttributeException - if the decimal value could not be set for the user attribute
    • setDoubleValue

      public static void setDoubleValue(List<UserAttribute> list, String name, double value) throws UserAttributeException
      Set the double value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      value - the double value for the user attribute
      Throws:
      UserAttributeException - if the double value could not be set for the user attribute
    • setIntegerValue

      public static void setIntegerValue(List<UserAttribute> list, String name, int value) throws UserAttributeException
      Set the int value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      value - the int value for the user attribute
      Throws:
      UserAttributeException - if the integer value could not be set for the user attribute
    • setLongValue

      public static void setLongValue(List<UserAttribute> list, String name, long value) throws UserAttributeException
      Set the long value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      value - the long value for the user attribute
      Throws:
      UserAttributeException - if the long value could not be set for the user attribute
    • setStringValue

      public static void setStringValue(List<UserAttribute> list, String name, String value) throws UserAttributeException
      Set the String value for the user attribute with the specified name in the specified list.
      Parameters:
      list - the user attributes to search
      name - the name of the attribute
      value - the String value for the user attribute
      Throws:
      UserAttributeException - if the string value could not be set for the user attribute
    • getBinaryValue

      public byte[] getBinaryValue() throws UserAttributeException
      Returns the binary value for the user attribute.
      Returns:
      the binary value for the user attribute
      Throws:
      UserAttributeException - if the binary value could not be retrieved for the user attribute
    • getDecimalValue

      public BigDecimal getDecimalValue() throws UserAttributeException
      Returns the BigDecimal value for the user attribute.
      Returns:
      the BigDecimal value for the user attribute
      Throws:
      UserAttributeException - if the decimal value could not be retrieved for the user attribute
    • getDoubleValue

      public double getDoubleValue() throws UserAttributeException
      Returns the double value for the user attribute.
      Returns:
      the double value for the user attribute
      Throws:
      UserAttributeException - if the double value could not be retrieved for the user attribute
    • getIntegerValue

      public int getIntegerValue() throws UserAttributeException
      Returns the int value for the user attribute.
      Returns:
      the int value for the user attribute
      Throws:
      UserAttributeException - if the integer value could not be retrieved for the user attribute
    • getLongValue

      public long getLongValue() throws UserAttributeException
      Returns the long value for the user attribute.
      Returns:
      the long value for the user attribute
      Throws:
      UserAttributeException - if the long value could not be retrieved for the user attribute
    • getName

      public String getName()
      Returns the name of the user attribute.
      Returns:
      the name of the user attribute
    • getStringValue

      public String getStringValue()
      Returns the String value for the user attribute.
      Returns:
      the String value for the user attribute
    • getValue

      public String getValue()
      Returns the String value for the user attribute.
      Returns:
      the String value for the user attribute
    • setBinaryValue

      public void setBinaryValue(africa.absa.inception.core.util.BinaryBuffer value)
      Set the binary value for the user attribute.
      Parameters:
      value - the binary value for the user attribute
    • setBinaryValue

      public void setBinaryValue(byte[] value)
      Set the binary value for the user attribute.
      Parameters:
      value - the binary value for the user attribute
    • setDecimalValue

      public void setDecimalValue(BigDecimal value)
      Set the BigDecimal value for the user attribute.
      Parameters:
      value - the BigDecimal value for the user attribute
    • setDoubleValue

      public void setDoubleValue(double value)
      Set the double value for the user attribute.
      Parameters:
      value - the double value for the user attribute
    • setIntegerValue

      public void setIntegerValue(int value)
      Set the int value for the user attribute.
      Parameters:
      value - the int value for the user attribute
    • setLongValue

      public void setLongValue(long value)
      Set the long value for the user attribute.
      Parameters:
      value - the long value for the user attribute
    • setName

      public void setName(String name)
      Set the name of the user attribute.
      Parameters:
      name - the name of the user attribute
    • setStringValue

      public void setStringValue(String value)
      Set the String value for the user attribute.
      Parameters:
      value - the String value for the user attribute