Record Class Peer
java.lang.Object
java.lang.Record
io.agentscope.harness.agent.gateway.channel.Peer
- Record Components:
kind- the peer classificationid- provider-assigned peer identifier (user id, channel id, thread id, etc.)
Identifies the conversation peer: who or what is being messaged (a user DM, a channel, a group,
or a thread). Used by
ChannelRouter for binding evaluation and session key construction.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PeerCreates a channel peer.static PeerCreates a direct / DM peer.final booleanIndicates whether some other object is "equal to" this one.static PeerCreates a group peer.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.key()Returns the composite key"<kind>:<id>"used in binding matching.kind()Returns the value of thekindrecord component.static PeerCreates a thread peer.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
key
Returns the composite key"<kind>:<id>"used in binding matching. -
direct
Creates a direct / DM peer. -
channel
Creates a channel peer. -
group
Creates a group peer. -
thread
Creates a thread peer. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-