All Downloads are FREE. Search and download functionalities are using the official Maven repository.

vertx-pg-client.row.rb Maven / Gradle / Ivy

There is a newer version: 0.6.0
Show newest version
require 'vertx-pg-client/tuple'
require 'vertx/buffer'
require 'vertx/util/utils.rb'
# Generated from com.julienviet.pgclient.Row
module VertxPgClient
  class Row < ::VertxPgClient::Tuple
    # @private
    # @param j_del [::VertxPgClient::Row] the java delegate
    def initialize(j_del)
      super(j_del)
      @j_del = j_del
    end
    # @private
    # @return [::VertxPgClient::Row] the underlying java delegate
    def j_del
      @j_del
    end
    @@j_api_type = Object.new
    def @@j_api_type.accept?(obj)
      obj.class == Row
    end
    def @@j_api_type.wrap(obj)
      Row.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::Row.java_class
    end
    #  Get a boolean value at pos.
    # @overload getBoolean(pos)
    #   @param [Fixnum] pos the position
    # @overload getBoolean(name)
    #   @param [String] name the column
    # @return [true,false] the value or null
    def get_boolean?(param_1=nil)
      if param_1.class == Fixnum && !block_given?
        return @j_del.java_method(:getBoolean, [Java::int.java_class]).call(param_1)
      elsif param_1.class == String && !block_given?
        return @j_del.java_method(:getBoolean, [Java::java.lang.String.java_class]).call(param_1)
      end
      raise ArgumentError, "Invalid arguments when calling get_boolean?(#{param_1})"
    end
    #  Get an object value at pos.
    # @overload getValue(pos)
    #   @param [Fixnum] pos the position
    # @overload getValue(name)
    #   @param [String] name the column
    # @return [Object] the value or null
    def get_value(param_1=nil)
      if param_1.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.from_object(@j_del.java_method(:getValue, [Java::int.java_class]).call(param_1))
      elsif param_1.class == String && !block_given?
        return ::Vertx::Util::Utils.from_object(@j_del.java_method(:getValue, [Java::java.lang.String.java_class]).call(param_1))
      end
      raise ArgumentError, "Invalid arguments when calling get_value(#{param_1})"
    end
    #  Get an integer value at pos.
    # @overload getInteger(pos)
    #   @param [Fixnum] pos the position
    # @overload getInteger(name)
    #   @param [String] name the column
    # @return [Fixnum] the value or null
    def get_integer(param_1=nil)
      if param_1.class == Fixnum && !block_given?
        return @j_del.java_method(:getInteger, [Java::int.java_class]).call(param_1)
      elsif param_1.class == String && !block_given?
        return @j_del.java_method(:getInteger, [Java::java.lang.String.java_class]).call(param_1)
      end
      raise ArgumentError, "Invalid arguments when calling get_integer(#{param_1})"
    end
    #  Get a long value at pos.
    # @overload getLong(pos)
    #   @param [Fixnum] pos the position
    # @overload getLong(name)
    #   @param [String] name the column
    # @return [Fixnum] the value or null
    def get_long(param_1=nil)
      if param_1.class == Fixnum && !block_given?
        return @j_del.java_method(:getLong, [Java::int.java_class]).call(param_1)
      elsif param_1.class == String && !block_given?
        return @j_del.java_method(:getLong, [Java::java.lang.String.java_class]).call(param_1)
      end
      raise ArgumentError, "Invalid arguments when calling get_long(#{param_1})"
    end
    #  Get a float value at pos.
    # @overload getFloat(pos)
    #   @param [Fixnum] pos the position
    # @overload getFloat(name)
    #   @param [String] name the column
    # @return [Float] the value or null
    def get_float(param_1=nil)
      if param_1.class == Fixnum && !block_given?
        return @j_del.java_method(:getFloat, [Java::int.java_class]).call(param_1)
      elsif param_1.class == String && !block_given?
        return @j_del.java_method(:getFloat, [Java::java.lang.String.java_class]).call(param_1)
      end
      raise ArgumentError, "Invalid arguments when calling get_float(#{param_1})"
    end
    #  Get a double value at pos.
    # @overload getDouble(pos)
    #   @param [Fixnum] pos the position
    # @overload getDouble(name)
    #   @param [String] name the column
    # @return [Float] the value or null
    def get_double(param_1=nil)
      if param_1.class == Fixnum && !block_given?
        return @j_del.java_method(:getDouble, [Java::int.java_class]).call(param_1)
      elsif param_1.class == String && !block_given?
        return @j_del.java_method(:getDouble, [Java::java.lang.String.java_class]).call(param_1)
      end
      raise ArgumentError, "Invalid arguments when calling get_double(#{param_1})"
    end
    #  Get a string value at pos.
    # @overload getString(pos)
    #   @param [Fixnum] pos the position
    # @overload getString(name)
    #   @param [String] name the column
    # @return [String] the value or null
    def get_string(param_1=nil)
      if param_1.class == Fixnum && !block_given?
        return @j_del.java_method(:getString, [Java::int.java_class]).call(param_1)
      elsif param_1.class == String && !block_given?
        return @j_del.java_method(:getString, [Java::java.lang.String.java_class]).call(param_1)
      end
      raise ArgumentError, "Invalid arguments when calling get_string(#{param_1})"
    end
    #  Get a string value at pos.
    # @overload getCharacter(pos)
    #   @param [Fixnum] pos the position
    # @overload getCharacter(name)
    #   @param [String] name the column
    # @return [Fixnum] the value or null
    def get_character(param_1=nil)
      if param_1.class == Fixnum && !block_given?
        return @j_del.java_method(:getCharacter, [Java::int.java_class]).call(param_1)
      elsif param_1.class == String && !block_given?
        return @j_del.java_method(:getCharacter, [Java::java.lang.String.java_class]).call(param_1)
      end
      raise ArgumentError, "Invalid arguments when calling get_character(#{param_1})"
    end
    #  Get a json object value at pos.
    # @overload getJsonObject(pos)
    #   @param [Fixnum] pos the position
    # @overload getJsonObject(name)
    #   @param [String] name the column
    # @return [Hash{String => Object}] the value or null
    def get_json_object(param_1=nil)
      if param_1.class == Fixnum && !block_given?
        return @j_del.java_method(:getJsonObject, [Java::int.java_class]).call(param_1) != nil ? JSON.parse(@j_del.java_method(:getJsonObject, [Java::int.java_class]).call(param_1).encode) : nil
      elsif param_1.class == String && !block_given?
        return @j_del.java_method(:getJsonObject, [Java::java.lang.String.java_class]).call(param_1) != nil ? JSON.parse(@j_del.java_method(:getJsonObject, [Java::java.lang.String.java_class]).call(param_1).encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling get_json_object(#{param_1})"
    end
    #  Get a json array value at pos.
    # @overload getJsonArray(pos)
    #   @param [Fixnum] pos the position
    # @overload getJsonArray(name)
    #   @param [String] name the column
    # @return [Array] the value or null
    def get_json_array(param_1=nil)
      if param_1.class == Fixnum && !block_given?
        return @j_del.java_method(:getJsonArray, [Java::int.java_class]).call(param_1) != nil ? JSON.parse(@j_del.java_method(:getJsonArray, [Java::int.java_class]).call(param_1).encode) : nil
      elsif param_1.class == String && !block_given?
        return @j_del.java_method(:getJsonArray, [Java::java.lang.String.java_class]).call(param_1) != nil ? JSON.parse(@j_del.java_method(:getJsonArray, [Java::java.lang.String.java_class]).call(param_1).encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling get_json_array(#{param_1})"
    end
    #  Get a buffer value at pos.
    # @overload getBuffer(pos)
    #   @param [Fixnum] pos the position
    # @overload getBuffer(name)
    #   @param [String] name the column
    # @return [::Vertx::Buffer] the value or null
    def get_buffer(param_1=nil)
      if param_1.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getBuffer, [Java::int.java_class]).call(param_1),::Vertx::Buffer)
      elsif param_1.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getBuffer, [Java::java.lang.String.java_class]).call(param_1),::Vertx::Buffer)
      end
      raise ArgumentError, "Invalid arguments when calling get_buffer(#{param_1})"
    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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy