org.apache.ignite.internal.client.thin

## Class ClientAtomicLongImpl

- java.lang.Object
- - org.apache.ignite.internal.client.thin.ClientAtomicLongImpl

All Implemented Interfaces:
  Closeable, AutoCloseable, ClientAtomicLong

    public class ClientAtomicLongImpl
    extends Object
    implements ClientAtomicLong

Client atomic long.

### Constructor Summary

Constructors
Constructor and Description
`ClientAtomicLongImpl(String name, @Nullable String groupName, org.apache.ignite.internal.client.thin.ReliableChannel ch)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `addAndGet(long l)` Adds `l` and gets current value of atomic long.
`void` `close()` Removes this atomic long.
`boolean` `compareAndSet(long expVal, long newVal)` Atomically compares current value to the expected value, and if they are equal, sets current value to new value.
`long` `decrementAndGet()` Decrements and gets current value of atomic long.
`long` `get()` Gets current value of atomic long.
`long` `getAndAdd(long l)` Gets current value of atomic long and adds `l`.
`long` `getAndDecrement()` Gets and decrements current value of atomic long.
`long` `getAndIncrement()` Gets and increments current value of atomic long.
`long` `getAndSet(long l)` Gets current value of atomic long and sets new value `l` of atomic long.
`long` `incrementAndGet()` Increments and gets current value of atomic long.
`String` `name()` Name of atomic long.
`boolean` `removed()` Gets status of atomic.

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

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

### Constructor Detail

#### ClientAtomicLongImpl

    public ClientAtomicLongImpl(String name,
                                @Nullable
                                @Nullable String groupName,
                                org.apache.ignite.internal.client.thin.ReliableChannel ch)

Constructor.

Parameters:
  `name` - Atomic long name.
  `groupName` - Cache group name.
  `ch` - Channel.

### Method Detail

#### name

    public String name()

Name of atomic long.

Specified by:
  `name` in interface `ClientAtomicLong`
Returns:
  Name of atomic long.

#### get

    public long get()
             throws IgniteException

Gets current value of atomic long.

Specified by:
  `get` in interface `ClientAtomicLong`
Returns:
  Current value of atomic long.
Throws:
  `IgniteException`

#### incrementAndGet

    public long incrementAndGet()
                         throws IgniteException

Increments and gets current value of atomic long.

Specified by:
  `incrementAndGet` in interface `ClientAtomicLong`
Returns:
  Value.
Throws:
  `IgniteException`

#### getAndIncrement

    public long getAndIncrement()
                         throws IgniteException

Gets and increments current value of atomic long.

Specified by:
  `getAndIncrement` in interface `ClientAtomicLong`
Returns:
  Value.
Throws:
  `IgniteException`

#### addAndGet

    public long addAndGet(long l)
                   throws IgniteException

Adds `l` and gets current value of atomic long.

Specified by:
  `addAndGet` in interface `ClientAtomicLong`
Parameters:
  `l` - Number which will be added.
Returns:
  Value.
Throws:
  `IgniteException`

#### getAndAdd

    public long getAndAdd(long l)
                   throws IgniteException

Gets current value of atomic long and adds `l`.

Specified by:
  `getAndAdd` in interface `ClientAtomicLong`
Parameters:
  `l` - Number which will be added.
Returns:
  Value.
Throws:
  `IgniteException`

#### decrementAndGet

    public long decrementAndGet()
                         throws IgniteException

Decrements and gets current value of atomic long.

Specified by:
  `decrementAndGet` in interface `ClientAtomicLong`
Returns:
  Value.
Throws:
  `IgniteException`

#### getAndDecrement

    public long getAndDecrement()
                         throws IgniteException

Gets and decrements current value of atomic long.

Specified by:
  `getAndDecrement` in interface `ClientAtomicLong`
Returns:
  Value.
Throws:
  `IgniteException`

#### getAndSet

    public long getAndSet(long l)
                   throws IgniteException

Gets current value of atomic long and sets new value `l` of atomic long.

Specified by:
  `getAndSet` in interface `ClientAtomicLong`
Parameters:
  `l` - New value of atomic long.
Returns:
  Value.
Throws:
  `IgniteException`

#### compareAndSet

    public boolean compareAndSet(long expVal,
                                 long newVal)
                          throws IgniteException

Atomically compares current value to the expected value, and if they are equal, sets current value to new value.

Specified by:
  `compareAndSet` in interface `ClientAtomicLong`
Parameters:
  `expVal` - Expected atomic long's value.
  `newVal` - New atomic long's value to set if current value equal to expected value.
Returns:
  `True` if comparison succeeded, `false` otherwise.
Throws:
  `IgniteException`

#### removed

    public boolean removed()

Gets status of atomic.

Specified by:
  `removed` in interface `ClientAtomicLong`
Returns:
  `true` if atomic was removed from cache, `false` in other case.

#### close

    public void close()

Removes this atomic long.

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `ClientAtomicLong`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023