Class EntitySelector

    • Constructor Detail

      • EntitySelector

        protected EntitySelector​(@Nullable
                                 @Nullable EntityOperation operation,
                                 @NotNull
                                 @NotNull Set<String> changesTo,
                                 @Nullable
                                 @Nullable String executingUser,
                                 @Nullable
                                 @Nullable String authenticatedUser,
                                 @NotNull
                                 @NotNull Map<String,​Object> txMetadata,
                                 @NotNull
                                 @NotNull Set<String> includeProperties,
                                 @NotNull
                                 @NotNull Set<String> excludeProperties)
    • Method Detail

      • getOperation

        @Nullable
        public @Nullable EntityOperation getOperation()
        Operation type performed on the entity.
        Returns:
        operation type
      • getChangesTo

        @NotNull
        public @NotNull Set<String> getChangesTo()
        Set of property names that have been added/updated or removed on the entity as a result of the change.
        Returns:
        set of properties
      • getExecutingUser

        @Nullable
        public @Nullable String getExecutingUser()
        Executing user that performed the change.
        Returns:
        executing user
      • getAuthenticatedUser

        @Nullable
        public @Nullable String getAuthenticatedUser()
        Authenticated user that performed the change.
        Returns:
        authenticated user
      • getTxMetadata

        @NotNull
        public @NotNull Map<String,​Object> getTxMetadata()
        Transaction metadata to match on the underlying transaction of the change.
        Returns:
        transaction metadata
      • getIncludeProperties

        @NotNull
        public @NotNull Set<String> getIncludeProperties()
        Set of properties to include in the returned change events.
        Returns:
        set of properties
      • getExcludeProperties

        @NotNull
        public @NotNull Set<String> getExcludeProperties()
        Set of properties to exclude from the returned change events.
        Returns:
        set of properties
      • matches

        public boolean matches​(ChangeEvent e)
        Checks if a given change event matches this selector.
        Specified by:
        matches in interface Selector
        Parameters:
        e - change event to check
        Returns:
        whether the event matches or not
      • applyProperties

        public ChangeEvent applyProperties​(ChangeEvent e)
        Performs desired filtering of property names based on includeProperties and excludeProperties.
        Specified by:
        applyProperties in interface Selector
        Parameters:
        e - change event to apply filtering on
        Returns:
        a new change event with filters applied
      • asMap

        public Map<String,​Object> asMap()
        Returns a map representation of this selector to be sent over to server.
        Specified by:
        asMap in interface Selector
        Returns:
        map representation
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object