public interface MetadataStore<T>
Modifier and Type | Method and Description |
---|---|
@NotNull List<MetadataValue> |
getMetadata(T subject,
@NotNull String metadataKey)
Returns all metadata values attached to an object.
|
boolean |
hasMetadata(T subject,
@NotNull String metadataKey)
Tests to see if a metadata attribute has been set on an object.
|
void |
invalidateAll(@NotNull Plugin owningPlugin)
Invalidates all metadata in the metadata store that originates from the
given plugin.
|
void |
removeMetadata(T subject,
@NotNull String metadataKey,
@NotNull Plugin owningPlugin)
Removes a metadata item owned by a plugin from a subject.
|
void |
setMetadata(T subject,
@NotNull String metadataKey,
@NotNull MetadataValue newMetadataValue)
Adds a metadata value to an object.
|
void setMetadata(@NotNull T subject, @NotNull @NotNull String metadataKey, @NotNull @NotNull MetadataValue newMetadataValue)
subject
- The object receiving the metadata.metadataKey
- A unique key to identify this metadata.newMetadataValue
- The metadata value to apply.IllegalArgumentException
- If value is null, or the owning plugin
is null@NotNull @NotNull List<MetadataValue> getMetadata(@NotNull T subject, @NotNull @NotNull String metadataKey)
subject
- the object being interrogated.metadataKey
- the unique metadata key being sought.boolean hasMetadata(@NotNull T subject, @NotNull @NotNull String metadataKey)
subject
- the object upon which the has-metadata test is
performed.metadataKey
- the unique metadata key being queried.void removeMetadata(@NotNull T subject, @NotNull @NotNull String metadataKey, @NotNull @NotNull Plugin owningPlugin)
subject
- the object to remove the metadata from.metadataKey
- the unique metadata key identifying the metadata to
remove.owningPlugin
- the plugin attempting to remove a metadata item.IllegalArgumentException
- If plugin is nullvoid invalidateAll(@NotNull @NotNull Plugin owningPlugin)
owningPlugin
- the plugin requesting the invalidation.IllegalArgumentException
- If plugin is nullCopyright © 2021. All rights reserved.