Interface SubjectRef.ToData<I>

  • Type Parameters:
    I - identifier type
    All Superinterfaces:
    SubjectRef<I>
    Enclosing interface:
    SubjectRef<I>

    public static interface SubjectRef.ToData<I>
    extends SubjectRef<I>
    A resolved reference to a subject's data in a specific collection.
    Since:
    2.0.0
    • Method Detail

      • update

        default CompletableFuture<Change<ImmutableSubjectData>> update​(Set<ContextValue<?>> contexts,
                                                                       UnaryOperator<Segment> modifierFunc)
        Update a single segment of the contained data based on the provided operator.
        Parameters:
        contexts - the contexts to update in
        modifierFunc - the function that will be called to update the data
        Returns:
        A future completing when data updates have been written to the data store
        Since:
        2.0.0
      • holdsListenersStrongly

        boolean holdsListenersStrongly()
        Get whether or not this reference will hold strong references to stored listeners. If the return value is false, registering a listener object with this reference will not prevent it from being garbage collected, so the listener must be held somewhere else for it to continue being called.
        Returns:
        Whether or not listeners are held strongly.
        Since:
        2.0.0
      • onUpdate

        void onUpdate​(Consumer<ImmutableSubjectData> listener)
        Register a listener to be called when an update is performed.
        Parameters:
        listener - The listener to register
        Since:
        2.0.0
      • isRegistered

        CompletableFuture<BooleanisRegistered()
        Confirm whether or not the subject data referenced is actually registered.
        Returns:
        a future completing with registration state
        Since:
        2.0.0