Class: VertxKafkaClient::KafkaConsumerRecords

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-kafka-client/kafka_consumer_records.rb

Overview

Vert.x Kafka consumer records

Instance Method Summary (collapse)

Instance Method Details

- (true, false) empty?

Returns whether this batch contains any records

Returns:

  • (true, false)
    whether this batch contains any records

Raises:

  • (ArgumentError)


27
28
29
30
31
32
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-kafka-client/kafka_consumer_records.rb', line 27

def empty?
  if !block_given?
    return @j_del.java_method(:isEmpty, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling empty?()"
end

- (::VertxKafkaClient::KafkaConsumerRecord) record_at(index = nil)

Get the record at the given index

Parameters:

  • index (Fixnum) (defaults to: nil)
    the index of the record to get

Returns:

Raises:

  • (ArgumentError)


36
37
38
39
40
41
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-kafka-client/kafka_consumer_records.rb', line 36

def record_at(index=nil)
  if index.class == Fixnum && !block_given?
    return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:recordAt, [Java::int.java_class]).call(index),::VertxKafkaClient::KafkaConsumerRecord, nil, nil)
  end
  raise ArgumentError, "Invalid arguments when calling record_at(#{index})"
end

- (Fixnum) size

Returns the total number of records in this batch

Returns:

  • (Fixnum)
    the total number of records in this batch

Raises:

  • (ArgumentError)


20
21
22
23
24
25
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-kafka-client/kafka_consumer_records.rb', line 20

def size
  if !block_given?
    return @j_del.java_method(:size, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling size()"
end