Package akka.javasdk.agent
Record Class MemoryFilter.Include
- Record Components:
ids- the set of agent component IDs to include messages fromroles- the set of agent roles to include messages from
- All Implemented Interfaces:
MemoryFilter
- Enclosing interface:
MemoryFilter
public static record MemoryFilter.Include(Set<String> ids, Set<String> roles)
extends Record
implements MemoryFilter
Filter that includes messages from agents with the specified component IDs or roles.
This filter uses OR logic: a message is included if either its component ID is in the
ids set OR its agent role is in the roles set.
When multiple Include filters are chained together using MemoryFilter, they are
automatically merged into a single Include filter with the union of all IDs and roles.
Example: An Include filter with ids={"agent-1", "agent-2"} and
roles={"summarizer"} will include:
- All messages from "agent-1" (regardless of role)
- All messages from "agent-2" (regardless of role)
- All messages with a role "summarizer" (regardless of component ID)
Messages that match none of these criteria are excluded.
-
Nested Class Summary
Nested classes/interfaces inherited from interface akka.javasdk.agent.MemoryFilter
MemoryFilter.Exclude, MemoryFilter.Include, MemoryFilter.MemoryFilterSupplier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryFilterstatic MemoryFilterstatic MemoryFilterstatic MemoryFilteragentRoles(Set<String> roles) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.ids()Returns the value of theidsrecord component.merge(MemoryFilter.Include other) roles()Returns the value of therolesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
merge
-
agentId
-
agentIds
-
agentRole
-
agentRoles
-
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). -
ids
Returns the value of theidsrecord component.- Returns:
- the value of the
idsrecord component
-
roles
Returns the value of therolesrecord component.- Returns:
- the value of the
rolesrecord component
-