/**
   * Create a (deep) clone of this object. The attributes in the CK_ATTRIBUTE[] need not be cloned,
   * as they can't be set separately.
   *
   * @return A clone of this object.
   * @preconditions
   * @postconditions (result <> null) and (result instanceof AttributeArray) and
   *     (result.equals(this))
   */
  public java.lang.Object clone() {
    AttributeArray clone;

    clone = (AttributeArray) super.clone();
    if (template_ == null) template_ = getAttributeArrayValue();
    if (template_ != null) clone.template_ = (GenericTemplate) this.template_.clone();
    return clone;
  }
  /**
   * Compares all member variables of this object with the other object. Returns only true, if all
   * are equal in both objects.
   *
   * @param otherObject The other object to compare to.
   * @return True, if other is an instance of this class and all member variables of both objects
   *     are equal. False, otherwise.
   * @preconditions
   * @postconditions
   */
  public boolean equals(java.lang.Object otherObject) {
    boolean equal = false;

    if (otherObject instanceof AttributeArray) {
      AttributeArray other = (AttributeArray) otherObject;
      if (this.template_ == null) this.template_ = this.getAttributeArrayValue();
      if (other.template_ == null) other.template_ = other.getAttributeArrayValue();
      equal =
          (this == other)
              || (((this.present_ == false) && (other.present_ == false))
                  || (((this.present_ == true) && (other.present_ == true))
                      && ((this.sensitive_ == other.sensitive_)
                          && (this.template_.equals(other.template_)))));
    }

    return equal;
  }