Struct Partition
Represents a Kafka partition.
Implements
Inherited Members
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
| Type | Name | Description | 
|---|---|---|
| int | 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 | 
|---|---|
| bool | 
Value
Gets the int value corresponding to this partition.
Declaration
public readonly int Value { get; }
  Property Value
| Type | Description | 
|---|---|
| int | 
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 | 
|---|---|
| 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
| Type | Name | Description | 
|---|---|---|
| object | obj | The object to test.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | true if obj is a Partition instance and has the same value. false otherwise.  | 
      
Overrides
GetHashCode()
Returns a hash code for this Partition.
Declaration
public override int GetHashCode()
  Returns
| Type | Description | 
|---|---|
| int | An integer that specifies a hash value for this Partition.  | 
      
Overrides
ToString()
Returns a string representation of the Partition object.
Declaration
public override string ToString()
  Returns
| Type | Description | 
|---|---|
| string | A string that represents the Partition object.  | 
      
Overrides
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
| Type | Name | Description | 
|---|---|---|
| Partition | a | The first Partition value to compare.  | 
      
| Partition | b | The second Partition value to compare.  | 
      
Returns
| Type | Description | 
|---|---|
| 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
| Type | Name | Description | 
|---|---|---|
| Partition | a | The first Partition value to compare.  | 
      
| Partition | b | The second Partition value to compare.  | 
      
Returns
| Type | Description | 
|---|---|
| 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
| Type | Name | Description | 
|---|---|---|
| Partition | a | The first Partition value to compare.  | 
      
| Partition | b | The second Partition value to compare.  | 
      
Returns
| Type | Description | 
|---|---|
| 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
| Type | Name | Description | 
|---|---|---|
| Partition | o | The Partition value to convert.  | 
      
Returns
| Type | Description | 
|---|---|
| int | 
implicit operator Partition(int)
Converts the specified int value to an Partition value.
Declaration
public static implicit operator Partition(int v)
  Parameters
| Type | Name | Description | 
|---|---|---|
| int | v | The int value to convert.  | 
      
Returns
| Type | Description | 
|---|---|
| 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
| Type | Name | Description | 
|---|---|---|
| Partition | a | The first Partition value to compare.  | 
      
| Partition | b | The second Partition value to compare.  | 
      
Returns
| Type | Description | 
|---|---|
| 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
| Type | Name | Description | 
|---|---|---|
| Partition | a | The first Partition value to compare.  | 
      
| Partition | b | The second Partition value to compare.  | 
      
Returns
| Type | Description | 
|---|---|
| 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
| Type | Name | Description | 
|---|---|---|
| Partition | a | The first Partition value to compare.  | 
      
| Partition | b | The second Partition value to compare.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | true if Partition value a is less than or equal to Partition value b. false otherwise.  |