Class: ReactivePgClient::Tuple

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb

Overview

A general purpose tuple.

Direct Known Subclasses

Row

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)

19
20
21
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 19

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

+ (Object) j_api_type


28
29
30
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 28

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class


31
32
33
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 31

def self.j_class
  Java::IoReactiversePgclient::Tuple.java_class
end

+ (::ReactivePgClient::Tuple) of(elt1 = nil, elt2 = nil, elt3 = nil, elt4 = nil, elt5 = nil, elt6 = nil)

Create a tuple of six elements.

Parameters:

  • elt1 (Object) (defaults to: nil)
    the first value
  • elt2 (Object) (defaults to: nil)
    the second valueg
  • elt3 (Object) (defaults to: nil)
    the third value
  • elt4 (Object) (defaults to: nil)
    the fourth value
  • elt5 (Object) (defaults to: nil)
    the fifth value
  • elt6 (Object) (defaults to: nil)
    the sixth value

Returns:

Raises:

  • (ArgumentError)

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 49

def self.of(elt1=nil,elt2=nil,elt3=nil,elt4=nil,elt5=nil,elt6=nil)
  if ::Vertx::Util::unknown_type.accept?(elt1) && !block_given? && elt2 == nil && elt3 == nil && elt4 == nil && elt5 == nil && elt6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoReactiversePgclient::Tuple.java_method(:of, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(elt1)),::ReactivePgClient::Tuple)
  elsif ::Vertx::Util::unknown_type.accept?(elt1) && ::Vertx::Util::unknown_type.accept?(elt2) && !block_given? && elt3 == nil && elt4 == nil && elt5 == nil && elt6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoReactiversePgclient::Tuple.java_method(:of, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(elt1),::Vertx::Util::Utils.to_object(elt2)),::ReactivePgClient::Tuple)
  elsif ::Vertx::Util::unknown_type.accept?(elt1) && ::Vertx::Util::unknown_type.accept?(elt2) && ::Vertx::Util::unknown_type.accept?(elt3) && !block_given? && elt4 == nil && elt5 == nil && elt6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoReactiversePgclient::Tuple.java_method(:of, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(elt1),::Vertx::Util::Utils.to_object(elt2),::Vertx::Util::Utils.to_object(elt3)),::ReactivePgClient::Tuple)
  elsif ::Vertx::Util::unknown_type.accept?(elt1) && ::Vertx::Util::unknown_type.accept?(elt2) && ::Vertx::Util::unknown_type.accept?(elt3) && ::Vertx::Util::unknown_type.accept?(elt4) && !block_given? && elt5 == nil && elt6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoReactiversePgclient::Tuple.java_method(:of, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(elt1),::Vertx::Util::Utils.to_object(elt2),::Vertx::Util::Utils.to_object(elt3),::Vertx::Util::Utils.to_object(elt4)),::ReactivePgClient::Tuple)
  elsif ::Vertx::Util::unknown_type.accept?(elt1) && ::Vertx::Util::unknown_type.accept?(elt2) && ::Vertx::Util::unknown_type.accept?(elt3) && ::Vertx::Util::unknown_type.accept?(elt4) && ::Vertx::Util::unknown_type.accept?(elt5) && !block_given? && elt6 == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoReactiversePgclient::Tuple.java_method(:of, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(elt1),::Vertx::Util::Utils.to_object(elt2),::Vertx::Util::Utils.to_object(elt3),::Vertx::Util::Utils.to_object(elt4),::Vertx::Util::Utils.to_object(elt5)),::ReactivePgClient::Tuple)
  elsif ::Vertx::Util::unknown_type.accept?(elt1) && ::Vertx::Util::unknown_type.accept?(elt2) && ::Vertx::Util::unknown_type.accept?(elt3) && ::Vertx::Util::unknown_type.accept?(elt4) && ::Vertx::Util::unknown_type.accept?(elt5) && ::Vertx::Util::unknown_type.accept?(elt6) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoReactiversePgclient::Tuple.java_method(:of, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(elt1),::Vertx::Util::Utils.to_object(elt2),::Vertx::Util::Utils.to_object(elt3),::Vertx::Util::Utils.to_object(elt4),::Vertx::Util::Utils.to_object(elt5),::Vertx::Util::Utils.to_object(elt6)),::ReactivePgClient::Tuple)
  end
  raise ArgumentError, "Invalid arguments when calling of(#{elt1},#{elt2},#{elt3},#{elt4},#{elt5},#{elt6})"
end

+ (::ReactivePgClient::Tuple) tuple

Returns a new empty tuple

Returns:

Raises:

  • (ArgumentError)

35
36
37
38
39
40
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 35

def self.tuple
  if !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoReactiversePgclient::Tuple.java_method(:tuple, []).call(),::ReactivePgClient::Tuple)
  end
  raise ArgumentError, "Invalid arguments when calling tuple()"
end

+ (Object) unwrap(obj)


25
26
27
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 25

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

+ (Object) wrap(obj)


22
23
24
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 22

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

Instance Method Details

- (self) add_boolean(value = nil)

Add a boolean value at the end of the tuple.

Parameters:

  • value (true, false) (defaults to: nil)
    the value

Returns:

  • (self)

Raises:

  • (ArgumentError)

158
159
160
161
162
163
164
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 158

def add_boolean(value=nil)
  if (value.class == TrueClass || value.class == FalseClass) && !block_given?
    @j_del.java_method(:addBoolean, [Java::JavaLang::Boolean.java_class]).call(value)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling add_boolean(#{value})"
end

- (self) add_buffer(value = nil)

Add a buffer value at the end of the tuple.

Parameters:

  • value (::Vertx::Buffer) (defaults to: nil)
    the value

Returns:

  • (self)

Raises:

  • (ArgumentError)

248
249
250
251
252
253
254
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 248

def add_buffer(value=nil)
  if value.class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:addBuffer, [Java::IoVertxCoreBuffer::Buffer.java_class]).call(value.j_del)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling add_buffer(#{value})"
end

- (self) add_double(value = nil)

Add a double value at the end of the tuple.

Parameters:

  • value (Float) (defaults to: nil)
    the value

Returns:

  • (self)

Raises:

  • (ArgumentError)

218
219
220
221
222
223
224
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 218

def add_double(value=nil)
  if value.class == Float && !block_given?
    @j_del.java_method(:addDouble, [Java::JavaLang::Double.java_class]).call(::Vertx::Util::Utils.to_double(value))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling add_double(#{value})"
end

- (self) add_float(value = nil)

Add a float value at the end of the tuple.

Parameters:

  • value (Float) (defaults to: nil)
    the value

Returns:

  • (self)

Raises:

  • (ArgumentError)

208
209
210
211
212
213
214
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 208

def add_float(value=nil)
  if value.class == Float && !block_given?
    @j_del.java_method(:addFloat, [Java::JavaLang::Float.java_class]).call(::Vertx::Util::Utils.to_float(value))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling add_float(#{value})"
end

- (self) add_integer(value = nil)

Add an integer value at the end of the tuple.

Parameters:

  • value (Fixnum) (defaults to: nil)
    the value

Returns:

  • (self)

Raises:

  • (ArgumentError)

188
189
190
191
192
193
194
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 188

def add_integer(value=nil)
  if value.class == Fixnum && !block_given?
    @j_del.java_method(:addInteger, [Java::JavaLang::Integer.java_class]).call(::Vertx::Util::Utils.to_integer(value))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling add_integer(#{value})"
end

- (self) add_json(value = nil)

Add a json value at the end of the tuple.

Parameters:

Returns:

  • (self)

Raises:

  • (ArgumentError)

238
239
240
241
242
243
244
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 238

def add_json(value=nil)
  if value.class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:addJson, [Java::IoReactiversePgclientData::Json.java_class]).call(value.j_del)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling add_json(#{value})"
end

- (self) add_long(value = nil)

Add a long value at the end of the tuple.

Parameters:

  • value (Fixnum) (defaults to: nil)
    the value

Returns:

  • (self)

Raises:

  • (ArgumentError)

198
199
200
201
202
203
204
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 198

def add_long(value=nil)
  if value.class == Fixnum && !block_given?
    @j_del.java_method(:addLong, [Java::JavaLang::Long.java_class]).call(value)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling add_long(#{value})"
end

- (self) add_short(value = nil)

Add a short value at the end of the tuple.

Parameters:

  • value (Fixnum) (defaults to: nil)
    the value

Returns:

  • (self)

Raises:

  • (ArgumentError)

178
179
180
181
182
183
184
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 178

def add_short(value=nil)
  if value.class == Fixnum && !block_given?
    @j_del.java_method(:addShort, [Java::JavaLang::Short.java_class]).call(::Vertx::Util::Utils.to_short(value))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling add_short(#{value})"
end

- (self) add_string(value = nil)

Add a string value at the end of the tuple.

Parameters:

  • value (String) (defaults to: nil)
    the value

Returns:

  • (self)

Raises:

  • (ArgumentError)

228
229
230
231
232
233
234
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 228

def add_string(value=nil)
  if value.class == String && !block_given?
    @j_del.java_method(:addString, [Java::java.lang.String.java_class]).call(value)
    return self
  end
  raise ArgumentError, "Invalid arguments when calling add_string(#{value})"
end

- (self) add_value(value = nil)

Add an object value at the end of the tuple.

Parameters:

  • value (Object) (defaults to: nil)
    the value

Returns:

  • (self)

Raises:

  • (ArgumentError)

168
169
170
171
172
173
174
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 168

def add_value(value=nil)
  if ::Vertx::Util::unknown_type.accept?(value) && !block_given?
    @j_del.java_method(:addValue, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(value))
    return self
  end
  raise ArgumentError, "Invalid arguments when calling add_value(#{value})"
end

- (void) clear

This method returns an undefined value.

Raises:

  • (ArgumentError)

263
264
265
266
267
268
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 263

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

- (true, false) get_boolean?(pos = nil)

Get a boolean value at pos.

Parameters:

  • pos (Fixnum) (defaults to: nil)
    the position

Returns:

  • (true, false)
    the value or null

Raises:

  • (ArgumentError)

68
69
70
71
72
73
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 68

def get_boolean?(pos=nil)
  if pos.class == Fixnum && !block_given?
    return @j_del.java_method(:getBoolean, [Java::int.java_class]).call(pos)
  end
  raise ArgumentError, "Invalid arguments when calling get_boolean?(#{pos})"
end

- (::Vertx::Buffer) get_buffer(pos = nil)

Get a buffer value at pos.

Parameters:

  • pos (Fixnum) (defaults to: nil)
    the position

Returns:

  • (::Vertx::Buffer)
    the value or null

Raises:

  • (ArgumentError)

149
150
151
152
153
154
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 149

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

- (Float) get_double(pos = nil)

Get a double value at pos.

Parameters:

  • pos (Fixnum) (defaults to: nil)
    the position

Returns:

  • (Float)
    the value or null

Raises:

  • (ArgumentError)

122
123
124
125
126
127
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 122

def get_double(pos=nil)
  if pos.class == Fixnum && !block_given?
    return @j_del.java_method(:getDouble, [Java::int.java_class]).call(pos)
  end
  raise ArgumentError, "Invalid arguments when calling get_double(#{pos})"
end

- (Float) get_float(pos = nil)

Get a float value at pos.

Parameters:

  • pos (Fixnum) (defaults to: nil)
    the position

Returns:

  • (Float)
    the value or null

Raises:

  • (ArgumentError)

113
114
115
116
117
118
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 113

def get_float(pos=nil)
  if pos.class == Fixnum && !block_given?
    return @j_del.java_method(:getFloat, [Java::int.java_class]).call(pos)
  end
  raise ArgumentError, "Invalid arguments when calling get_float(#{pos})"
end

- (Fixnum) get_integer(pos = nil)

Get an integer value at pos.

Parameters:

  • pos (Fixnum) (defaults to: nil)
    the position

Returns:

  • (Fixnum)
    the value or null

Raises:

  • (ArgumentError)

95
96
97
98
99
100
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 95

def get_integer(pos=nil)
  if pos.class == Fixnum && !block_given?
    return @j_del.java_method(:getInteger, [Java::int.java_class]).call(pos)
  end
  raise ArgumentError, "Invalid arguments when calling get_integer(#{pos})"
end

- (::ReactivePgClient::Json) get_json(pos = nil)

Get a json value at pos.

Parameters:

  • pos (Fixnum) (defaults to: nil)
    the position

Returns:

Raises:

  • (ArgumentError)

140
141
142
143
144
145
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 140

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

- (Fixnum) get_long(pos = nil)

Get a long value at pos.

Parameters:

  • pos (Fixnum) (defaults to: nil)
    the position

Returns:

  • (Fixnum)
    the value or null

Raises:

  • (ArgumentError)

104
105
106
107
108
109
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 104

def get_long(pos=nil)
  if pos.class == Fixnum && !block_given?
    return @j_del.java_method(:getLong, [Java::int.java_class]).call(pos)
  end
  raise ArgumentError, "Invalid arguments when calling get_long(#{pos})"
end

- (Fixnum) get_short(pos = nil)

Get a short value at pos.

Parameters:

  • pos (Fixnum) (defaults to: nil)
    the position

Returns:

  • (Fixnum)
    the value or null

Raises:

  • (ArgumentError)

86
87
88
89
90
91
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 86

def get_short(pos=nil)
  if pos.class == Fixnum && !block_given?
    return @j_del.java_method(:getShort, [Java::int.java_class]).call(pos)
  end
  raise ArgumentError, "Invalid arguments when calling get_short(#{pos})"
end

- (String) get_string(pos = nil)

Get a string value at pos.

Parameters:

  • pos (Fixnum) (defaults to: nil)
    the position

Returns:

  • (String)
    the value or null

Raises:

  • (ArgumentError)

131
132
133
134
135
136
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 131

def get_string(pos=nil)
  if pos.class == Fixnum && !block_given?
    return @j_del.java_method(:getString, [Java::int.java_class]).call(pos)
  end
  raise ArgumentError, "Invalid arguments when calling get_string(#{pos})"
end

- (Object) get_value(pos = nil)

Get an object value at pos.

Parameters:

  • pos (Fixnum) (defaults to: nil)
    the position

Returns:

  • (Object)
    the value or null

Raises:

  • (ArgumentError)

77
78
79
80
81
82
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 77

def get_value(pos=nil)
  if pos.class == Fixnum && !block_given?
    return ::Vertx::Util::Utils.from_object(@j_del.java_method(:getValue, [Java::int.java_class]).call(pos))
  end
  raise ArgumentError, "Invalid arguments when calling get_value(#{pos})"
end

- (Fixnum) size

Returns the tuple size

Returns:

  • (Fixnum)
    the tuple size

Raises:

  • (ArgumentError)

256
257
258
259
260
261
# File '/Users/julien/java/reactive-pg-client/target/classes/reactive-pg-client/tuple.rb', line 256

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