confluent-kafka-dotnet
Show / Hide Table of Contents

Struct Offset

Represents a Kafka partition offset value.

Implements
System.IEquatable<Offset>
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 Offset : IEquatable<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

Fields

Beginning

A special value that refers to the beginning of a partition.

Declaration
public static readonly Offset Beginning
Field Value
Type Description
Offset

End

A special value that refers to the end of a partition.

Declaration
public static readonly Offset End
Field Value
Type Description
Offset

Stored

A special value that refers to the stored offset for a partition.

Declaration
public static readonly Offset Stored
Field Value
Type Description
Offset

Unset

A special value that refers to an invalid, unassigned or default partition offset.

Declaration
public static readonly Offset Unset
Field Value
Type Description
Offset

Properties

IsSpecial

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

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

Value

Gets the long value corresponding to this offset.

Declaration
public readonly long Value { get; }
Property Value
Type Description
System.Int64

Methods

Equals(Offset)

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

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

The offset to test.

Returns
Type Description
System.Boolean

true if other has the same value. false otherwise.

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
System.ValueType.Equals(System.Object)

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
System.ValueType.GetHashCode()

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
System.ValueType.ToString()

Operators

Addition(Offset, Int32)

Add an integer value to an Offset value.

Declaration
public static Offset operator +(Offset a, int b)
Parameters
Type Name Description
Offset a

The Offset value to add the integer value to.

System.Int32 b

The integer value to add to the Offset value.

Returns
Type Description
Offset

The Offset value incremented by the integer value b.

Addition(Offset, Int64)

Add a long value to an Offset value.

Declaration
public static Offset operator +(Offset a, long b)
Parameters
Type Name Description
Offset a

The Offset value to add the long value to.

System.Int64 b

The long value to add to the Offset value.

Returns
Type Description
Offset

The Offset value incremented by the long value b.

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.

Implements

System.IEquatable<T>
In This Article