confluent-kafka-dotnet
Show / Hide Table of Contents

Struct Partition

Represents a Kafka partition.

Implements
System.IEquatable<Partition>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: Confluent.Kafka
Assembly: cs.temp.dll.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(Int32)

Initializes a new instance of the Partition structure.

Declaration
public Partition(int partition)
Parameters
Type Name Description
System.Int32 partition

The partition value

Fields

Any

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

Declaration
public static readonly Partition Any
Field Value
Type Description
Partition

Properties

IsSpecial

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

Declaration
public bool IsSpecial { get; }
Property Value
Type Description
System.Boolean

Value

Gets the int value corresponding to this partition.

Declaration
public int Value { get; }
Property Value
Type Description
System.Int32

Methods

Equals(Partition)

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

Declaration
public bool Equals(Partition other)
Parameters
Type Name Description
Partition other

The partition to test.

Returns
Type Description
System.Boolean

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
Type Name Description
System.Object obj

The object to test.

Returns
Type Description
System.Boolean

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

Overrides
System.ValueType.Equals(System.Object)

GetHashCode()

Returns a hash code for this Partition.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

An integer that specifies a hash value for this Partition.

Overrides
System.ValueType.GetHashCode()

ToString()

Returns a string representation of the Partition object.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string that represents the Partition object.

Overrides
System.ValueType.ToString()

Operators

Equality(Partition, Partition)

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

Declaration
public static bool operator ==(Partition a, Partition b)
Parameters
Type Name Description
Partition a

The first Partition value to compare.

Partition b

The second Partition value to compare.

Returns
Type Description
System.Boolean

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

GreaterThan(Partition, Partition)

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

Declaration
public static bool operator>(Partition a, Partition b)
Parameters
Type Name Description
Partition a

The first Partition value to compare.

Partition b

The second Partition value to compare.

Returns
Type Description
System.Boolean

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

GreaterThanOrEqual(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
Type Name Description
Partition a

The first Partition value to compare.

Partition b

The second Partition value to compare.

Returns
Type Description
System.Boolean

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

Implicit(Partition to Int32)

Converts the specified Partition value to an int value.

Declaration
public static implicit operator int (Partition o)
Parameters
Type Name Description
Partition o

The Partition value to convert.

Returns
Type Description
System.Int32

Implicit(Int32 to Partition)

Converts the specified int value to an Partition value.

Declaration
public static implicit operator Partition(int v)
Parameters
Type Name Description
System.Int32 v

The int value to convert.

Returns
Type Description
Partition

Inequality(Partition, Partition)

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

Declaration
public static bool operator !=(Partition a, Partition b)
Parameters
Type Name Description
Partition a

The first Partition value to compare.

Partition b

The second Partition value to compare.

Returns
Type Description
System.Boolean

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

LessThan(Partition, Partition)

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

Declaration
public static bool operator <(Partition a, Partition b)
Parameters
Type Name Description
Partition a

The first Partition value to compare.

Partition b

The second Partition value to compare.

Returns
Type Description
System.Boolean

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

LessThanOrEqual(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
Type Name Description
Partition a

The first Partition value to compare.

Partition b

The second Partition value to compare.

Returns
Type Description
System.Boolean

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

Implements

System.IEquatable<T>