confluent-kafka-dotnet
Show / Hide Table of Contents

Struct Partition

Represents a Kafka partition.

Implements
IEquatable<Partition>
Inherited Members
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: Confluent.Kafka
Assembly: Confluent.Kafka.dll
Syntax
public struct Partition : IEquatable<Partition>
Remarks

This structure is the same size as an int - its purpose is to add some syntactical sugar related to special values.

Constructors

Partition(int)

Initializes a new instance of the Partition structure.

Declaration
public Partition(int partition)
Parameters
TypeNameDescription
intpartition

The partition value

Fields

Any

A special value that refers to an unspecified / unknown partition.

Declaration
public static readonly Partition Any
Field Value
TypeDescription
Partition

Properties

IsSpecial

Gets whether or not this is one of the special partition values.

Declaration
public bool IsSpecial { get; }
Property Value
TypeDescription
bool

Value

Gets the int value corresponding to this partition.

Declaration
public readonly int Value { get; }
Property Value
TypeDescription
int

Methods

Equals(Partition)

Tests whether this Partition value is equal to the specified Partition.

Declaration
public bool Equals(Partition other)
Parameters
TypeNameDescription
Partitionother

The partition to test.

Returns
TypeDescription
bool

true if other has the same value. false otherwise.

Equals(object)

Tests whether this Partition value is equal to the specified object.

Declaration
public override bool Equals(object obj)
Parameters
TypeNameDescription
objectobj

The object to test.

Returns
TypeDescription
bool

true if obj is a Partition instance and has the same value. false otherwise.

Overrides
ValueType.Equals(object)

GetHashCode()

Returns a hash code for this Partition.

Declaration
public override int GetHashCode()
Returns
TypeDescription
int

An integer that specifies a hash value for this Partition.

Overrides
ValueType.GetHashCode()

ToString()

Returns a string representation of the Partition object.

Declaration
public override string ToString()
Returns
TypeDescription
string

A string that represents the Partition object.

Overrides
ValueType.ToString()

Operators

operator ==(Partition, Partition)

Tests whether Partition value a is equal to Partition value b.

Declaration
public static bool operator ==(Partition a, Partition b)
Parameters
TypeNameDescription
Partitiona

The first Partition value to compare.

Partitionb

The second Partition value to compare.

Returns
TypeDescription
bool

true if Partition value a and b are equal. false otherwise.

operator >(Partition, Partition)

Tests whether Partition value a is greater than Partition value b.

Declaration
public static bool operator >(Partition a, Partition b)
Parameters
TypeNameDescription
Partitiona

The first Partition value to compare.

Partitionb

The second Partition value to compare.

Returns
TypeDescription
bool

true if Partition value a is greater than Partition value b. false otherwise.

operator >=(Partition, Partition)

Tests whether Partition value a is greater than or equal to Partition value b.

Declaration
public static bool operator >=(Partition a, Partition b)
Parameters
TypeNameDescription
Partitiona

The first Partition value to compare.

Partitionb

The second Partition value to compare.

Returns
TypeDescription
bool

true if Partition value a is greater than or equal to Partition value b. false otherwise.

implicit operator int(Partition)

Converts the specified Partition value to an int value.

Declaration
public static implicit operator int(Partition o)
Parameters
TypeNameDescription
Partitiono

The Partition value to convert.

Returns
TypeDescription
int

implicit operator Partition(int)

Converts the specified int value to an Partition value.

Declaration
public static implicit operator Partition(int v)
Parameters
TypeNameDescription
intv

The int value to convert.

Returns
TypeDescription
Partition

operator !=(Partition, Partition)

Tests whether Partition value a is not equal to Partition value b.

Declaration
public static bool operator !=(Partition a, Partition b)
Parameters
TypeNameDescription
Partitiona

The first Partition value to compare.

Partitionb

The second Partition value to compare.

Returns
TypeDescription
bool

true if Partition value a and b are not equal. false otherwise.

operator <(Partition, Partition)

Tests whether Partition value a is less than Partition value b.

Declaration
public static bool operator <(Partition a, Partition b)
Parameters
TypeNameDescription
Partitiona

The first Partition value to compare.

Partitionb

The second Partition value to compare.

Returns
TypeDescription
bool

true if Partition value a is less than Partition value b. false otherwise.

operator <=(Partition, Partition)

Tests whether Partition value a is less than or equal to Partition value b.

Declaration
public static bool operator <=(Partition a, Partition b)
Parameters
TypeNameDescription
Partitiona

The first Partition value to compare.

Partitionb

The second Partition value to compare.

Returns
TypeDescription
bool

true if Partition value a is less than or equal to Partition value b. false otherwise.

Implements

IEquatable<T>
In this article