Class MetaParamsInternalMetadata

java.lang.Object
org.infinispan.functional.impl.MetaParamsInternalMetadata
All Implemented Interfaces:
MetaParam.Lookup, InternalMetadata, Metadata

@Experimental @ProtoTypeId(1003) public final class MetaParamsInternalMetadata extends Object implements InternalMetadata, MetaParam.Lookup
Metadata parameters backed internal metadata representation.
Since:
8.0
  • Method Details

    • from

      public static Metadata from(MetaParams params)
    • created

      @ProtoField(number=3, defaultValue="-1") public long created()
      Specified by:
      created in interface InternalMetadata
    • lastUsed

      @ProtoField(number=4, defaultValue="-1") public long lastUsed()
      Specified by:
      lastUsed in interface InternalMetadata
    • isExpired

      public boolean isExpired(long now)
      Specified by:
      isExpired in interface InternalMetadata
    • expiryTime

      public long expiryTime()
      Specified by:
      expiryTime in interface InternalMetadata
    • lifespan

      @ProtoField(number=5, defaultValue="-1") public long lifespan()
      Description copied from interface: Metadata
      Returns the lifespan of the cache entry with which this metadata object is associated, in milliseconds. Negative values are interpreted as unlimited lifespan.
      Specified by:
      lifespan in interface Metadata
      Returns:
      lifespan of the entry in number of milliseconds
    • maxIdle

      @ProtoField(number=6, defaultValue="-1") public long maxIdle()
      Description copied from interface: Metadata
      Returns the the maximum amount of time that the cache entry associated with this metadata object is allowed to be idle for before it is considered as expired, in milliseconds.
      Specified by:
      maxIdle in interface Metadata
      Returns:
      maximum idle time of the entry in number of milliseconds
    • counterConfiguration

      @ProtoField(7) public CounterConfiguration counterConfiguration()
    • updateCreationTimestamp

      @ProtoField(value=8, defaultValue="true") public boolean updateCreationTimestamp()
      Description copied from interface: Metadata
      Returns if the creation timestamp is updated when an entry is modified.

      Created entries always update the creation timestamp.

      This capability is experimental and all Infinispan implementations return true. To update creation timestamps you must create a custom Metadata implementation.

      Specified by:
      updateCreationTimestamp in interface Metadata
      Returns:
      true to update the creation timestamp when entries are modified.
    • version

      public EntryVersion version()
      Description copied from interface: Metadata
      Returns the version of the cache entry with which this metadata object is associated.
      Specified by:
      version in interface Metadata
      Returns:
      version of the entry
    • builder

      Description copied from interface: Metadata
      Returns an instance of Metadata.Builder which can be used to build new instances of Metadata instance which are full copies of this Metadata.
      Specified by:
      builder in interface Metadata
      Returns:
      instance of Metadata.Builder
    • findMetaParam

      public <T extends MetaParam> Optional<T> findMetaParam(Class<T> type)
      Description copied from interface: MetaParam.Lookup
      Returns a non-empty Optional instance containing a metadata parameter instance that can be assigned to the type Class passed in, or an empty Optional if no metadata can be assigned to that type.
      Specified by:
      findMetaParam in interface MetaParam.Lookup
      Type Parameters:
      T - metadata parameter type
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Metadata
      Returns whether this metadata is effectively empty, that is that persisting or replicating it to another node would be no different then sending a null metadata object.
      Specified by:
      isEmpty in interface Metadata
      Returns:
      if this metadata has no actual data to store
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getBuilder

    • empty

      public static MetaParamsInternalMetadata empty()