Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
require 'vertx/buffer'
require 'vertx/util/utils.rb'
# Generated from com.julienviet.pgclient.Tuple
module VertxPgClient
# A general purpose tuple.
class Tuple
# @private
# @param j_del [::VertxPgClient::Tuple] the java delegate
def initialize(j_del)
@j_del = j_del
end
# @private
# @return [::VertxPgClient::Tuple] the underlying java delegate
def j_del
@j_del
end
@@j_api_type = Object.new
def @@j_api_type.accept?(obj)
obj.class == Tuple
end
def @@j_api_type.wrap(obj)
Tuple.new(obj)
end
def @@j_api_type.unwrap(obj)
obj.j_del
end
def self.j_api_type
@@j_api_type
end
def self.j_class
Java::ComJulienvietPgclient::Tuple.java_class
end
# @return [::VertxPgClient::Tuple] a new empty tuple
def self.tuple
if !block_given?
return ::Vertx::Util::Utils.safe_create(Java::ComJulienvietPgclient::Tuple.java_method(:tuple, []).call(),::VertxPgClient::Tuple)
end
raise ArgumentError, "Invalid arguments when calling tuple()"
end
# Create a tuple of six elements.
# @param [Object] elt1 the first value
# @param [Object] elt2 the second value
# @param [Object] elt3 the third value
# @param [Object] elt4 the fourth value
# @param [Object] elt5 the sixth value
# @param [Object] elt6
# @return [::VertxPgClient::Tuple] the tuple
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::ComJulienvietPgclient::Tuple.java_method(:of, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(elt1)),::VertxPgClient::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::ComJulienvietPgclient::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)),::VertxPgClient::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::ComJulienvietPgclient::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)),::VertxPgClient::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::ComJulienvietPgclient::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)),::VertxPgClient::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::ComJulienvietPgclient::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)),::VertxPgClient::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::ComJulienvietPgclient::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)),::VertxPgClient::Tuple)
end
raise ArgumentError, "Invalid arguments when calling of(#{elt1},#{elt2},#{elt3},#{elt4},#{elt5},#{elt6})"
end
# Get a boolean value at pos.
# @param [Fixnum] pos the position
# @return [true,false] the value or null
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
# Get an object value at pos.
# @param [Fixnum] pos the position
# @return [Object] the value or null
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
# Get an integer value at pos.
# @param [Fixnum] pos the position
# @return [Fixnum] the value or null
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
# Get a long value at pos.
# @param [Fixnum] pos the position
# @return [Fixnum] the value or null
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
# Get a float value at pos.
# @param [Fixnum] pos the position
# @return [Float] the value or null
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
# Get a double value at pos.
# @param [Fixnum] pos the position
# @return [Float] the value or null
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
# Get a string value at pos.
# @param [Fixnum] pos the position
# @return [String] the value or null
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
# Get a Character value at pos.
# @param [Fixnum] pos the position
# @return [Fixnum] the value or null
def get_character(pos=nil)
if pos.class == Fixnum && !block_given?
return @j_del.java_method(:getCharacter, [Java::int.java_class]).call(pos)
end
raise ArgumentError, "Invalid arguments when calling get_character(#{pos})"
end
# Get a json object value at pos.
# @param [Fixnum] pos the position
# @return [Hash{String => Object}] the value or null
def get_json_object(pos=nil)
if pos.class == Fixnum && !block_given?
return @j_del.java_method(:getJsonObject, [Java::int.java_class]).call(pos) != nil ? JSON.parse(@j_del.java_method(:getJsonObject, [Java::int.java_class]).call(pos).encode) : nil
end
raise ArgumentError, "Invalid arguments when calling get_json_object(#{pos})"
end
# Get a json array value at pos.
# @param [Fixnum] pos the position
# @return [Array] the value or null
def get_json_array(pos=nil)
if pos.class == Fixnum && !block_given?
return @j_del.java_method(:getJsonArray, [Java::int.java_class]).call(pos) != nil ? JSON.parse(@j_del.java_method(:getJsonArray, [Java::int.java_class]).call(pos).encode) : nil
end
raise ArgumentError, "Invalid arguments when calling get_json_array(#{pos})"
end
# Get a buffer value at pos.
# @param [Fixnum] pos the position
# @return [::Vertx::Buffer] the value or null
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
# Add a boolean value at the end of the tuple.
# @param [true,false] value the value
# @return [self]
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
# Add an object value at the end of the tuple.
# @param [Object] value the value
# @return [self]
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
# Add an integer value at the end of the tuple.
# @param [Fixnum] value the value
# @return [self]
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
# Add a long value at the end of the tuple.
# @param [Fixnum] value the value
# @return [self]
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
# Add a float value at the end of the tuple.
# @param [Float] value the value
# @return [self]
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
# Add a double value at the end of the tuple.
# @param [Float] value the value
# @return [self]
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
# Add a string value at the end of the tuple.
# @param [String] value the value
# @return [self]
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
# Add a Character value at the end of the tuple.
# @param [Fixnum] value the value
# @return [self]
def add_character(value=nil)
if value.class == Fixnum && !block_given?
@j_del.java_method(:addCharacter, [Java::JavaLang::Character.java_class]).call(::Vertx::Util::Utils.to_character(value))
return self
end
raise ArgumentError, "Invalid arguments when calling add_character(#{value})"
end
# Add a json object value at the end of the tuple.
# @param [Hash{String => Object}] value the value
# @return [self]
def add_json_object(value=nil)
if value.class == Hash && !block_given?
@j_del.java_method(:addJsonObject, [Java::IoVertxCoreJson::JsonObject.java_class]).call(::Vertx::Util::Utils.to_json_object(value))
return self
end
raise ArgumentError, "Invalid arguments when calling add_json_object(#{value})"
end
# Add a json array value at the end of the tuple.
# @param [Array] value the value
# @return [self]
def add_json_array(value=nil)
if value.class == Array && !block_given?
@j_del.java_method(:addJsonArray, [Java::IoVertxCoreJson::JsonArray.java_class]).call(::Vertx::Util::Utils.to_json_array(value))
return self
end
raise ArgumentError, "Invalid arguments when calling add_json_array(#{value})"
end
# Add a buffer value at the end of the tuple.
# @param [::Vertx::Buffer] value the value
# @return [self]
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
# @return [Fixnum] the tuple size
def size
if !block_given?
return @j_del.java_method(:size, []).call()
end
raise ArgumentError, "Invalid arguments when calling size()"
end
end
end