Interface Metadata.Builder

All Known Implementing Classes:
EmbeddedMetadata.Builder, MemcachedMetadata.Builder, MetaParamsInternalMetadata.Builder
Enclosing interface:
Metadata

public static interface Metadata.Builder
Metadata builder
  • Method Details

    • lifespan

      Metadata.Builder lifespan(long time, TimeUnit unit)
      Set lifespan time with a given time unit.
      Parameters:
      time - of lifespan
      unit - unit of time for lifespan time
      Returns:
      a builder instance with the lifespan time applied
    • lifespan

      Metadata.Builder lifespan(long time)
      Set lifespan time assuming that the time unit is milliseconds.
      Parameters:
      time - of lifespan, in milliseconds
      Returns:
      a builder instance with the lifespan time applied
    • maxIdle

      Metadata.Builder maxIdle(long time, TimeUnit unit)
      Set max idle time with a given time unit.
      Parameters:
      time - of max idle
      unit - of max idle time
      Returns:
      a builder instance with the max idle time applied
    • maxIdle

      Metadata.Builder maxIdle(long time)
      Set max idle time assuming that the time unit is milliseconds.
      Parameters:
      time - of max idle, in milliseconds
      Returns:
      a builder instance with the max idle time applied
    • version

      Metadata.Builder version(EntryVersion version)
      Set version.
      Parameters:
      version - of the metadata
      Returns:
      a builder instance with the version applied
    • updateCreationTimestamp

      @Experimental default Metadata.Builder updateCreationTimestamp(boolean enabled)
      Sets how the creation timestamp is updated.

      Affects mortal entries only; in other words, for entries where Metadata.lifespan() is greater than zero.

      When true (default), the creation timestamp is updated when an entry is created or modified. When set to false, the creation timestamp is updated only when the entry is created.

      The capability is experimental and Infinispan Metadata and Metadata.Builder does not implement this method. To not update creation timestamps you must create a custom Metadata and Metadata.Builder implementation.

      Parameters:
      enabled - false to disable creation timestamp update when modifying entries.
      Returns:
      a builder instance with the version applied.
    • build

      Metadata build()
      Build a metadata instance.
      Returns:
      an instance of metadata
    • merge

      Metadata.Builder merge(Metadata metadata)
      Merges the given metadata information into the given builder.
      Parameters:
      metadata - to merge into this builder
      Returns:
      a builder instance with the metadata applied