com.hazelcast.crdt.pncounter.operations

## Class CRDTTimestampedLong

- java.lang.Object
- - com.hazelcast.crdt.pncounter.operations.CRDTTimestampedLong

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable

      public class CRDTTimestampedLong
      extends Object
      implements IdentifiedDataSerializable

  Response for CRDT PN counter operations which contains the PN counter value as well as the current replica vector clock. The vector clock is returned for maintaining session consistency guarantees.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CRDTTimestampedLong()`
    `CRDTTimestampedLong(long value, com.hazelcast.cluster.impl.VectorClock vectorClock)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `int` | `getId()` Returns type identifier for this class.
    `long` | `getValue()`
    `com.hazelcast.cluster.impl.VectorClock` | `getVectorClock()`
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `void` | `setValue(long value)`
    `void` | `setVectorClock(com.hazelcast.cluster.impl.VectorClock vectorClock)`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CRDTTimestampedLong

          public CRDTTimestampedLong()

    - #### CRDTTimestampedLong

          public CRDTTimestampedLong(long value,
                                     com.hazelcast.cluster.impl.VectorClock vectorClock)

  - ### Method Detail

    - #### getValue

          public long getValue()

    - #### getVectorClock

          public com.hazelcast.cluster.impl.VectorClock getVectorClock()

    - #### setValue

          public void setValue(long value)

    - #### setVectorClock

          public void setVectorClock(com.hazelcast.cluster.impl.VectorClock vectorClock)

    - #### getFactoryId

          public int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed.

    - #### readData

          public void readData(ObjectDataInput in)
                        throws IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

Copyright © 2020. All rights reserved.