Package akka.javasdk.agent
Record Class MemoryFilter.Exclude
- Record Components:
ids- the set of agent component IDs to exclude messages fromroles- the set of agent roles to exclude messages from
- All Implemented Interfaces:
MemoryFilter
- Enclosing interface:
MemoryFilter
public static record MemoryFilter.Exclude(Set<String> ids, Set<String> roles)
extends Record
implements MemoryFilter
Filter that excludes messages from agents with the specified component IDs or roles.
This filter uses OR logic for exclusion: a message is excluded if either its component ID is
in the ids set OR its agent role is in the roles set. A message is excluded
only if any conditions are met:
When multiple Exclude filters are chained together using MemoryFilter, they are
automatically merged into a single Exclude filter with the union of all IDs and roles.
Example: An Exclude filter with ids={"agent-1"} and
roles={"worker"} will exclude:
- All messages from "agent-1" (regardless of role)
- All messages with a role "worker" (regardless of component ID)
Messages that don't match any of these exclusion criteria are included. Messages with no
agent role are only excluded if their component ID is in the ids set.
-
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.Exclude 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
-