Class: VertxKafkaClient::KafkaHeader

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-kafka-client/kafka_header.rb

Overview

Vert.x Kafka producer record header.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


18
19
20
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-kafka-client/kafka_header.rb', line 18

def @@j_api_type.accept?(obj)
  obj.class == KafkaHeader
end

+ (::VertxKafkaClient::KafkaHeader) header(key, value) + (::VertxKafkaClient::KafkaHeader) header(key, value)

Overloads:

Returns:

Raises:

  • (ArgumentError)


40
41
42
43
44
45
46
47
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-kafka-client/kafka_header.rb', line 40

def self.header(param_1=nil,param_2=nil)
  if param_1.class == String && param_2.class.method_defined?(:j_del) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxKafkaClientProducer::KafkaHeader.java_method(:header, [Java::java.lang.String.java_class,Java::IoVertxCoreBuffer::Buffer.java_class]).call(param_1,param_2.j_del),::VertxKafkaClient::KafkaHeader)
  elsif param_1.class == String && param_2.class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxKafkaClientProducer::KafkaHeader.java_method(:header, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2),::VertxKafkaClient::KafkaHeader)
  end
  raise ArgumentError, "Invalid arguments when calling header(#{param_1},#{param_2})"
end

+ (Object) j_api_type



27
28
29
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-kafka-client/kafka_header.rb', line 27

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



30
31
32
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-kafka-client/kafka_header.rb', line 30

def self.j_class
  Java::IoVertxKafkaClientProducer::KafkaHeader.java_class
end

+ (Object) unwrap(obj)



24
25
26
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-kafka-client/kafka_header.rb', line 24

def @@j_api_type.unwrap(obj)
  obj.j_del
end

+ (Object) wrap(obj)



21
22
23
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-kafka-client/kafka_header.rb', line 21

def @@j_api_type.wrap(obj)
  KafkaHeader.new(obj)
end

Instance Method Details

- (String) key

Returns the buffer key

Returns:

  • (String)
    the buffer key

Raises:

  • (ArgumentError)


49
50
51
52
53
54
55
56
57
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-kafka-client/kafka_header.rb', line 49

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

- (::Vertx::Buffer) value

Returns the buffer value

Returns:

Raises:

  • (ArgumentError)


59
60
61
62
63
64
65
66
67
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-kafka-client/kafka_header.rb', line 59

def value
  if !block_given?
    if @cached_value != nil
      return @cached_value
    end
    return @cached_value = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:value, []).call(),::Vertx::Buffer)
  end
  raise ArgumentError, "Invalid arguments when calling value()"
end