java.lang.Object
com.hazelcast.hibernate.serialization.Expirable
com.hazelcast.hibernate.serialization.Value
All Implemented Interfaces:
com.hazelcast.nio.serialization.DataSerializable, com.hazelcast.nio.serialization.IdentifiedDataSerializable

public class Value extends Expirable
A value within a region cache
  • Constructor Details

    • Value

      public Value()
    • Value

      public Value(Object version, long timestamp, Object value)
  • Method Details

    • isReplaceableBy

      public boolean isReplaceableBy(long txTimestamp, Object newVersion, Comparator versionComparator)
      Description copied from class: Expirable
      Determine if the current entry can be overridden with a value corresponding to the given new version and the transaction timestamp.
      Specified by:
      isReplaceableBy in class Expirable
      Parameters:
      txTimestamp - the timestamp of the transaction
      newVersion - the new version for the replacement value
      versionComparator - the comparator to use for the version
      Returns:
      true if the value can be replaced, false otherwise
    • getTimestamp

      public long getTimestamp()
    • getValue

      public Object getValue()
      Specified by:
      getValue in class Expirable
      Returns:
      the value contained, or null if none exists
    • getValue

      public Object getValue(long txTimestamp)
      Specified by:
      getValue in class Expirable
      Parameters:
      txTimestamp - the timestamp of the transaction
      Returns:
      the value contained if it was created before the transaction timestamp or null
    • matches

      public boolean matches(ExpiryMarker lock)
      Specified by:
      matches in class Expirable
      Returns:
      true if the Expirable matches using the specified lock, false otherwise
      See Also:
    • markForExpiration

      public ExpiryMarker markForExpiration(long timeout, String nextMarkerId)
      Description copied from class: Expirable
      Mark the entry for expiration with the given timeout and marker id.

      For every invocation a corresponding call to ExpiryMarker.expire(long) should be made, provided that the returned marker Expirable.matches(ExpiryMarker)

      Specified by:
      markForExpiration in class Expirable
      Parameters:
      timeout - the timestamp in which the lock times out
      nextMarkerId - the next lock id to use if creating a new lock
      Returns:
      the newly created marker, or the current marker with a higher multiplicity
      See Also:
    • readData

      public void readData(com.hazelcast.nio.ObjectDataInput in) throws IOException
      Specified by:
      readData in interface com.hazelcast.nio.serialization.DataSerializable
      Overrides:
      readData in class Expirable
      Throws:
      IOException
    • writeData

      public void writeData(com.hazelcast.nio.ObjectDataOutput out) throws IOException
      Specified by:
      writeData in interface com.hazelcast.nio.serialization.DataSerializable
      Overrides:
      writeData in class Expirable
      Throws:
      IOException
    • getFactoryId

      public int getFactoryId()
    • getClassId

      public int getClassId()
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Expirable