com.hazelcast.client.proxy

## Class ClientPNCounterProxy

- java.lang.Object
- - com.hazelcast.client.spi.ClientProxy
  - - com.hazelcast.client.proxy.ClientPNCounterProxy

- All Implemented Interfaces:
    DistributedObject, PNCounter

      public class ClientPNCounterProxy
      extends ClientProxy
      implements PNCounter

  Client proxy implementation for a `PNCounter`.

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.client.spi.ClientProxy

      `name`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientPNCounterProxy(String serviceName, String objectName, ClientContext context)` Creates a client `PNCounter` proxy

  - ### 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.
    `long` | `incrementAndGet()` Increments by one the current value.
    `void` | `reset()` Resets the observed state by this PN counter.
    `long` | `subtractAndGet(long delta)` Subtracts the given value from the current value.
    `String` | `toString()`

    - ### Methods inherited from class com.hazelcast.client.spi.ClientProxy

      `deregisterListener, destroy, destroyLocally, destroyRemotely, equals, getClient, getConnectedServerVersion, getContext, getDistributedObjectName, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invoke, invokeOnAddress, invokeOnPartition, invokeOnPartitionInterruptibly, onDestroy, onInitialize, onShutdown, postDestroy, preDestroy, registerListener, setContext, toData, toObject`

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

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

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

      `destroy, getName, getPartitionKey, getServiceName`

- - ### Constructor Detail

    - #### ClientPNCounterProxy

          public ClientPNCounterProxy(String serviceName,
                                      String objectName,
                                      ClientContext context)

      Creates a client `PNCounter` proxy
      Parameters:
        `serviceName` - the service name
        `objectName` - the PNCounter name
        `context` - the client context containing references to services and configuration

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `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.

Copyright © 2019. All rights reserved.