ObserverSpec.Builder


public final class ObserverSpec.Builder


Builder for ObserverSpec instances.

Summary

Public constructors

Public methods

@NonNull ObserverSpec.Builder
addFilterDocumentClasses(@NonNull Class[] documentClasses)

Restricts an observer using this spec to triggering only for documents of one of the provided document classes.

@NonNull ObserverSpec.Builder

Restricts an observer using this spec to triggering only for documents of one of the provided document classes.

@NonNull ObserverSpec.Builder
addFilterSchemas(@NonNull String[] schemas)

Restricts an observer using this spec to triggering only for documents of one of the provided schema types.

@NonNull ObserverSpec.Builder

Restricts an observer using this spec to triggering only for documents of one of the provided schema types.

@NonNull ObserverSpec

Constructs a new ObserverSpec from the contents of this builder.

Public constructors

Builder

Added in 1.1.0-alpha07
public Builder()

Public methods

addFilterDocumentClasses

public @NonNull ObserverSpec.Builder addFilterDocumentClasses(@NonNull Class[] documentClasses)

Restricts an observer using this spec to triggering only for documents of one of the provided document classes.

If unset, the observer will match documents of all types.

Merged list available from getFilterSchemas.

Parameters
@NonNull Class[] documentClasses

classes annotated with Document.

addFilterDocumentClasses

Added in 1.1.0-alpha07
public @NonNull ObserverSpec.Builder addFilterDocumentClasses(
    @NonNull Collection<Class<Object>> documentClasses
)

Restricts an observer using this spec to triggering only for documents of one of the provided document classes.

If unset, the observer will match documents of all types.

Merged list available from getFilterSchemas.

Parameters
@NonNull Collection<Class<Object>> documentClasses

classes annotated with Document.

addFilterSchemas

public @NonNull ObserverSpec.Builder addFilterSchemas(@NonNull String[] schemas)

Restricts an observer using this spec to triggering only for documents of one of the provided schema types.

If unset, the observer will match documents of all types.

addFilterSchemas

Added in 1.1.0-alpha07
public @NonNull ObserverSpec.Builder addFilterSchemas(@NonNull Collection<String> schemas)

Restricts an observer using this spec to triggering only for documents of one of the provided schema types.

If unset, the observer will match documents of all types.

build

Added in 1.1.0-alpha07
public @NonNull ObserverSpec build()

Constructs a new ObserverSpec from the contents of this builder.