Class Attributes

java.lang.Object
org.cryptacular.x509.dn.Attributes
All Implemented Interfaces:
Iterable<Attribute>

public class Attributes extends Object implements Iterable<Attribute>
Ordered list of Attributes.
Author:
Middleware Services
  • Constructor Details

    • Attributes

      public Attributes()
  • Method Details

    • add

      public void add(String typeOid, String value)
      Adds an attribute by type and value to the end of the attribute list.
      Parameters:
      typeOid - OID of attribute type.
      value - Attribute value.
    • add

      public void add(Attribute attr)
      Adds the given attribute to the end of the attribute list.
      Parameters:
      attr - Non-null attribute.
    • size

      public int size()
      Gets the number of attributes contained in this instance.
      Returns:
      Number of attributes.
    • getAll

      public List<Attribute> getAll()
      Gets an immutable list of attributes.
      Returns:
      Non-null immutable attribute list.
    • getValues

      public List<String> getValues(AttributeType type)
      Gets an immutable list of all attributes of the given type. The order of the returned list reflects the ordering of the underlying attributes.
      Parameters:
      type - Attribute type.
      Returns:
      Non-null list of attributes of given type. An empty list is returned if there are no attributes of the given type.
    • getValue

      public String getValue(AttributeType type)
      Gets the first value of the given type that appears in the attribute list.
      Parameters:
      type - Attribute type.
      Returns:
      Value of first attribute of given type or null if no attributes of given type exist.
    • iterator

      public Iterator<Attribute> iterator()
      Specified by:
      iterator in interface Iterable<Attribute>