-
Notifications
You must be signed in to change notification settings - Fork 25
[IDEA] Extend the API of Destination set to be able to query it #42
Description
Is your feature request related to a problem? Please describe.
I have a use case where I needed to know if the DestinationSet was empty or not but the current API doesn't allow any querying. It only allows to remove destinations. I was also expecting it to be a set but it actually inherits from Object not from Set
Describe your use case
Checking if there is any destination in the DSet.
Describe the solution you'd like
Have a size() or isEmpty() method.
Describe alternatives you've considered
The workaround for what I need to do was creating a custom list for destinations and check against it from a parameter value (the name of the destination), and checking if the DSet was empty would have been quicker because I do a remoceAllExcept() of that parameter, so if the DSet is empty it means the given destination is working I wrong, which is what I needed to do.
Additional context
Creating a router for a http listener, that does destinationSet.removeAllExcept([xxx]); and I need to check if xxx is actually a valid destination or not, meaning the destinationSet would be empty.
REFs: