com.hazelcast.crdt.pncounter

## Class PNCounterProxy

- java.lang.Object
- - com.hazelcast.spi.AbstractDistributedObject<PNCounterService>
  - - com.hazelcast.crdt.pncounter.PNCounterProxy

- All Implemented Interfaces:
    DistributedObject, PNCounter

      public class PNCounterProxy
      extends AbstractDistributedObject<PNCounterService>
      implements PNCounter

  Member proxy implementation for a `PNCounter`.

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.spi.AbstractDistributedObject

      `PARTITIONING_STRATEGY`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `addAndGet(long delta)` Adds the given value to the current value.
    `long` | `decrementAndGet()` Decrements by one the current value.
    `long` | `get()` Returns the current value of the counter.
    `long` | `getAndAdd(long delta)` Adds the given value to the current value.
    `long` | `getAndDecrement()` Decrements by one the current value.
    `long` | `getAndIncrement()` Increments by one the current value.
    `long` | `getAndSubtract(long delta)` Subtracts the given value from the current value.
    `Address` | `getCurrentTargetReplicaAddress()` Returns the current target replica address to which this proxy is sending invocations.
    `String` | `getName()` Returns the unique name for this DistributedObject.
    `String` | `getServiceName()` Returns the service name for this object.
    `long` | `incrementAndGet()` Increments by one the current value.
    `void` | `reset()` Resets the observed state by this PN counter.
    `void` | `setOperationTryCount(int operationTryCount)` Sets the operation retry count for PN counter operations.
    `long` | `subtractAndGet(long delta)` Subtracts the given value from the current value.
    `String` | `toString()`

    - ### Methods inherited from class com.hazelcast.spi.AbstractDistributedObject

      `destroy, equals, getDistributedObjectName, getNameAsPartitionAwareData, getNodeEngine, getOperationService, getPartitionId, getPartitionKey, getService, hashCode, invalidate, invokeOnPartition, isClusterVersionEqualTo, isClusterVersionGreaterOrEqual, isClusterVersionGreaterThan, isClusterVersionLessOrEqual, isClusterVersionLessThan, isClusterVersionUnknown, isClusterVersionUnknownOrGreaterOrEqual, isClusterVersionUnknownOrGreaterThan, isClusterVersionUnknownOrLessOrEqual, isClusterVersionUnknownOrLessThan, postDestroy, preDestroy, throwNotActiveException, toData`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.hazelcast.core.DistributedObject

      `destroy, getPartitionKey`

- - ### Method Detail

    - #### getName

          public String getName()

      Description copied from interface: `DistributedObject`
      Returns the unique name for this DistributedObject. The returned value will never be null. The suggested way for getting name is retrieving it through `DistributedObjectUtil.getName(DistributedObject)` because this might be also a `PrefixedDistributedObject`.
      Specified by:
        `getName` in interface `DistributedObject`
      Returns:
        the unique name for this object.

    - #### getServiceName

          public String getServiceName()

      Description copied from interface: `DistributedObject`
      Returns the service name for this object.
      Specified by:
        `getServiceName` in interface `DistributedObject`
      Specified by:
        `getServiceName` in class `AbstractDistributedObject<PNCounterService>`
      Returns:
        the service name for this object.

    - #### get

          public long get()

      Description copied from interface: `PNCounter`
      Returns the current value of the counter.
      Specified by:
        `get` in interface `PNCounter`
      See Also:
        `Cluster.getClusterVersion()`

    - #### getAndAdd

          public long getAndAdd(long delta)

      Description copied from interface: `PNCounter`
      Adds the given value to the current value.
      Specified by:
        `getAndAdd` in interface `PNCounter`
      Parameters:
        `delta` - the value to add
      Returns:
        the previous value
      See Also:
        `Cluster.getClusterVersion()`

    - #### addAndGet

          public long addAndGet(long delta)

      Description copied from interface: `PNCounter`
      Adds the given value to the current value.
      Specified by:
        `addAndGet` in interface `PNCounter`
      Parameters:
        `delta` - the value to add
      Returns:
        the updated value
      See Also:
        `Cluster.getClusterVersion()`

    - #### getAndSubtract

          public long getAndSubtract(long delta)

      Description copied from interface: `PNCounter`
      Subtracts the given value from the current value.
      Specified by:
        `getAndSubtract` in interface `PNCounter`
      Parameters:
        `delta` - the value to add
      Returns:
        the previous value
      See Also:
        `Cluster.getClusterVersion()`

    - #### subtractAndGet

          public long subtractAndGet(long delta)

      Description copied from interface: `PNCounter`
      Subtracts the given value from the current value.
      Specified by:
        `subtractAndGet` in interface `PNCounter`
      Parameters:
        `delta` - the value to subtract
      Returns:
        the updated value
      See Also:
        `Cluster.getClusterVersion()`

    - #### decrementAndGet

          public long decrementAndGet()

      Description copied from interface: `PNCounter`
      Decrements by one the current value.
      Specified by:
        `decrementAndGet` in interface `PNCounter`
      Returns:
        the updated value
      See Also:
        `Cluster.getClusterVersion()`

    - #### incrementAndGet

          public long incrementAndGet()

      Description copied from interface: `PNCounter`
      Increments by one the current value.
      Specified by:
        `incrementAndGet` in interface `PNCounter`
      Returns:
        the updated value
      See Also:
        `Cluster.getClusterVersion()`

    - #### getAndDecrement

          public long getAndDecrement()

      Description copied from interface: `PNCounter`
      Decrements by one the current value.
      Specified by:
        `getAndDecrement` in interface `PNCounter`
      Returns:
        the previous value
      See Also:
        `Cluster.getClusterVersion()`

    - #### getAndIncrement

          public long getAndIncrement()

      Description copied from interface: `PNCounter`
      Increments by one the current value.
      Specified by:
        `getAndIncrement` in interface `PNCounter`
      Returns:
        the previous value
      See Also:
        `Cluster.getClusterVersion()`

    - #### reset

          public void reset()

      Description copied from interface: `PNCounter`
      Resets the observed state by this PN counter. This method may be used after a method invocation has thrown a `ConsistencyLostException` to reset the proxy and to be able to start a new session.
      Specified by:
        `reset` in interface `PNCounter`

    - #### getCurrentTargetReplicaAddress

          public Address getCurrentTargetReplicaAddress()

      Returns the current target replica address to which this proxy is sending invocations.

    - #### setOperationTryCount

          public void setOperationTryCount(int operationTryCount)

      Sets the operation retry count for PN counter operations.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractDistributedObject<PNCounterService>`

Copyright © 2019. All rights reserved.