Class ClientQA

java.lang.Object
de.aristaflow.adept2.core.client.ClientQA

public class ClientQA extends Object
A lot of frameworks use a session ID to identify users. This can be provided to a QualifiedAgent. However, this ID will normally be ignored when comparing agents. This is insufficient for client applications and components that are based on such frameworks. In these cases the ID needs to be respected when comparing agents.
This class wraps a normal QualifiedAgent but its equals(Object) and hashCode() additionally take the session ID into account.

Never compare a QualifiedAgent with this, that is, never call QualifiedAgent.equals(Object) with a ClientQA instance; only call equals(Object) with a ClientQA or a QualifiedAgent.

  • Field Details

    • agent

      protected final QualifiedAgent agent
      The wrapped QualifiedAgent of this client agent.
  • Constructor Details

    • ClientQA

      public ClientQA(QualifiedAgent agent)
      Creates a new client agent wrapping the designated QualifiedAgent.
      Parameters:
      agent - The qualified agent to be wrapped by a client agent.
  • Method Details

    • getAgent

      public QualifiedAgent getAgent()
      Gets the wrapped QualifiedAgent of this client agent.
      Returns:
      The wrapped QualifiedAgent of this client agent.
    • toString

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

      public boolean equals(Object obj)
      Compares to a QualifiedAgent and/or to a ClientQA. Equal is determined by comparing the agents and additionally the user session ID.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object