org.apache.ignite.internal.processors.affinity

## Class AffinityTopologyVersion

- java.lang.Object
- - org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion

All Implemented Interfaces:
  Externalizable, Serializable, Comparable<AffinityTopologyVersion>, Message

    public class AffinityTopologyVersion
    extends Object
    implements Comparable<AffinityTopologyVersion>, Externalizable, Message

See Also:
  Serialized Form

### Field Summary

Fields
`static AffinityTopologyVersion` `NONE`
`static AffinityTopologyVersion` `ZERO`

### Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message

`DIRECT_TYPE_SIZE`

### Constructor Summary

Constructors
Constructor and Description
`AffinityTopologyVersion()` Empty constructor required by `Externalizable`.
`AffinityTopologyVersion(long topVer)`
`AffinityTopologyVersion(long topVer, int minorTopVer)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `after(AffinityTopologyVersion topVer)`
`boolean` `before(AffinityTopologyVersion topVer)`
`int` `compareTo(AffinityTopologyVersion o)`
`short` `directType()` Gets message type.
`boolean` `equals(Object o)`
`byte` `fieldsCount()` Gets fields count.
`int` `hashCode()`
`boolean` `initialized()`
`boolean` `isBetween(AffinityTopologyVersion lower, AffinityTopologyVersion upper)`
`int` `minorTopologyVersion()`
`AffinityTopologyVersion` `nextMinorVersion()`
`void` `onAckReceived()` Method called when ack message received.
`void` `readExternal(ObjectInput in)`
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`long` `topologyVersion()`
`String` `toString()`
`void` `writeExternal(ObjectOutput out)`
`boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

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

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

### Field Detail

#### NONE

    public static final AffinityTopologyVersion NONE

#### ZERO

    public static final AffinityTopologyVersion ZERO

### Constructor Detail

#### AffinityTopologyVersion

    public AffinityTopologyVersion()

Empty constructor required by `Externalizable`.

#### AffinityTopologyVersion

    public AffinityTopologyVersion(long topVer)

Parameters:
  `topVer` - Topology version.

#### AffinityTopologyVersion

    public AffinityTopologyVersion(long topVer,
                                   int minorTopVer)

Parameters:
  `topVer` - Topology version.
  `minorTopVer` - Minor topology version.

### Method Detail

#### initialized

    public boolean initialized()

Returns:
  `True` if this is real topology version (neither `NONE` nor `ZERO`.

#### nextMinorVersion

    public AffinityTopologyVersion nextMinorVersion()

Returns:
  Topology version with incremented minor version.

#### topologyVersion

    public long topologyVersion()

Returns:
  Topology version.

#### minorTopologyVersion

    public int minorTopologyVersion()

Returns:
  Minor topology version.

#### compareTo

    public int compareTo(AffinityTopologyVersion o)

Specified by:
  `compareTo` in interface `Comparable<AffinityTopologyVersion>`

#### isBetween

    public final boolean isBetween(AffinityTopologyVersion lower,
                                   AffinityTopologyVersion upper)

Parameters:
  `lower` - Lower bound.
  `upper` - Upper bound.
Returns:
  `True` if this topology version is within provided bounds (inclusive).

#### after

    public final boolean after(AffinityTopologyVersion topVer)

Parameters:
  `topVer` - Test version.
Returns:
  `True` if this topology happens strictly after than `topVer`.

#### before

    public final boolean before(AffinityTopologyVersion topVer)

Parameters:
  `topVer` - Test version.
Returns:
  `True` if this topology happens strictly before than `topVer`.

#### onAckReceived

    public void onAckReceived()

Method called when ack message received.

Specified by:
  `onAckReceived` in interface `Message`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### writeTo

    public boolean writeTo(ByteBuffer buf,
                           MessageWriter writer)

Writes this message to provided byte buffer.

Specified by:
  `writeTo` in interface `Message`
Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public boolean readFrom(ByteBuffer buf,
                            MessageReader reader)

Reads this message from provided byte buffer.

Specified by:
  `readFrom` in interface `Message`
Parameters:
  `buf` - Byte buffer.
  `reader` - Reader.
Returns:
  Whether message was fully read.

#### directType

    public short directType()

Gets message type.

Specified by:
  `directType` in interface `Message`
Returns:
  Message type.

#### fieldsCount

    public byte fieldsCount()

Gets fields count.

Specified by:
  `fieldsCount` in interface `Message`
Returns:
  Fields count.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021