Class NostrFilter
java.lang.Object
org.ngengine.nostr4j.proto.NostrMessageFragment
org.ngengine.nostr4j.NostrFilter
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
Nip01UserMetadataFilter, NostrSearchFilter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()getIds()getKinds()getLimit()getSince()getTags()getTagValues(String key) getUntil()limit(int limit) booleanmatches(SignedNostrEvent event) Checks if the given event matches this filter according to NIP-01 specsbooleanmatches(SignedNostrEvent event, boolean anyTagValue) Checks if the given event matches this filterbooleanmatches(SignedNostrEvent event, int count) Checks if the given event matches this filter according to NIP-01 specsbooleanmatches(SignedNostrEvent event, int count, boolean anyTagValue) Checks if the given event matches this filtertoMap()withAuthor(String author) withAuthor(NostrPublicKey author) withKind(int kind) Methods inherited from class NostrMessageFragment
toString
-
Constructor Details
-
NostrFilter
public NostrFilter() -
NostrFilter
-
-
Method Details
-
clone
-
withId
-
getIds
-
withAuthor
-
withAuthor
-
getAuthors
-
withKind
-
getKinds
-
since
-
getSince
-
getUntil
-
until
-
limit
-
getLimit
-
withTag
-
getTags
-
getTagValues
-
toMap
- Specified by:
toMapin classNostrMessageFragment
-
matches
Checks if the given event matches this filter according to NIP-01 specs- Parameters:
event- the event to check- Returns:
- true if the event matches the filter, false otherwise
-
matches
Checks if the given event matches this filter- Parameters:
event- the event to checkanyTagValue- if true, the filter will match if any of the tag values matches, otherwise it will only match if the first tag value matches (default nostr behavior per nip-01 spec).- Returns:
-
matches
Checks if the given event matches this filter according to NIP-01 specs- Parameters:
event- the event to checkcount- the number of events already matched by this filter (used for limit)- Returns:
- true if the event matches the filter, false otherwise
-
matches
Checks if the given event matches this filter- Parameters:
event- the event to checkcount- the number of events already matched by this filter (used for limit)anyTagValue- if true, the filter will match if any of the tag values matches, otherwise it will only match if the first tag value matches (default nostr behavior per nip-01 spec).- Returns:
- true if the event matches the filter, false otherwise
-