Struct Offset
Represents a Kafka partition offset value.
Inherited Members
Namespace: Confluent.Kafka
Assembly: cs.temp.dll.dll
Syntax
public struct Offset
Remarks
This structure is the same size as a long - its purpose is to add some syntactical sugar related to special values.
Constructors
Offset(Int64)
Initializes a new instance of the Offset structure.
Declaration
public Offset(long offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | offset | The offset value |
Properties
Beginning
A special value that refers to the beginning of a partition.
Declaration
public static Offset Beginning { get; }
Property Value
Type | Description |
---|---|
Offset |
End
A special value that refers to the end of a partition.
Declaration
public static Offset End { get; }
Property Value
Type | Description |
---|---|
Offset |
Invalid
A special value that refers to an invalid, unassigned or default partition offset.
Declaration
public static Offset Invalid { get; }
Property Value
Type | Description |
---|---|
Offset |
IsSpecial
Gets whether or not this is one of the special offset values.
Declaration
public bool IsSpecial { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Stored
A special value thet refers to the stored offset for a partition.
Declaration
public static Offset Stored { get; }
Property Value
Type | Description |
---|---|
Offset |
Value
Gets the long value corresponding to this offset.
Declaration
public long Value { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Methods
Equals(Object)
Tests whether this Offset 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 an Offset and has the same value. false otherwise. |
Overrides
GetHashCode()
Returns a hash code for this Offset.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | An integer that specifies a hash value for this Offset. |
Overrides
ToString()
Returns a string representation of the Offset object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string that represents the Offset object. |
Overrides
Operators
Equality(Offset, Offset)
Tests whether Offset value a is equal to Offset value b.
Declaration
public static bool operator ==(Offset a, Offset b)
Parameters
Type | Name | Description |
---|---|---|
Offset | a | The first Offset value to compare. |
Offset | b | The second Offset value to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if Offset value a and b are equal. false otherwise. |
GreaterThan(Offset, Offset)
Tests whether Offset value a is greater than Offset value b.
Declaration
public static bool operator>(Offset a, Offset b)
Parameters
Type | Name | Description |
---|---|---|
Offset | a | The first Offset value to compare. |
Offset | b | The second Offset value to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if Offset value a is greater than Offset value b. false otherwise. |
GreaterThanOrEqual(Offset, Offset)
Tests whether Offset value a is greater than or equal to Offset value b.
Declaration
public static bool operator >=(Offset a, Offset b)
Parameters
Type | Name | Description |
---|---|---|
Offset | a | The first Offset value to compare. |
Offset | b | The second Offset value to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if Offset value a is greater than or equal to Offset value b. false otherwise. |
Implicit(Offset to Int64)
Converts the specified Offset value to a long value.
Declaration
public static implicit operator long (Offset o)
Parameters
Type | Name | Description |
---|---|---|
Offset | o | The Offset value to convert. |
Returns
Type | Description |
---|---|
System.Int64 |
Implicit(Int64 to Offset)
Converts the specified long value to an Offset value.
Declaration
public static implicit operator Offset(long v)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | v | THe long value to convert. |
Returns
Type | Description |
---|---|
Offset |
Inequality(Offset, Offset)
Tests whether Offset value a is not equal to Offset value b.
Declaration
public static bool operator !=(Offset a, Offset b)
Parameters
Type | Name | Description |
---|---|---|
Offset | a | The first Offset value to compare. |
Offset | b | The second Offset value to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if Offset value a and b are not equal. false otherwise. |
LessThan(Offset, Offset)
Tests whether Offset value a is less than Offset value b.
Declaration
public static bool operator <(Offset a, Offset b)
Parameters
Type | Name | Description |
---|---|---|
Offset | a | The first Offset value to compare. |
Offset | b | The second Offset value to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if Offset value a is less than Offset value b. false otherwise. |
LessThanOrEqual(Offset, Offset)
Tests whether Offset value a is less than or equal to Offset value b.
Declaration
public static bool operator <=(Offset a, Offset b)
Parameters
Type | Name | Description |
---|---|---|
Offset | a | The first Offset value to compare. |
Offset | b | The second Offset value to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if Offset value a is less than or equal to Offset value b. false otherwise. |