Class 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.
    Author:
    Ulrich Kreher
    • Field Detail

      • agent

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

      • 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 Detail

      • getAgent

        public QualifiedAgent getAgent()
        Gets the wrapped QualifiedAgent of this client agent.
        Returns:
        The wrapped QualifiedAgent of this client agent.
      • 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