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

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

There is a newer version: 0.6.0
Show newest version
require 'vertx-pg-client/pg_iterator'
require 'vertx/util/utils.rb'
# Generated from com.julienviet.pgclient.PgResult
module VertxPgClient
  #  Represents the result of an operation on database.
  class PgResult
    # @private
    # @param j_del [::VertxPgClient::PgResult] the java delegate
    def initialize(j_del, j_arg_T=nil)
      @j_del = j_del
      @j_arg_T = j_arg_T != nil ? j_arg_T : ::Vertx::Util::unknown_type
    end
    # @private
    # @return [::VertxPgClient::PgResult] the underlying java delegate
    def j_del
      @j_del
    end
    #  Get the number of the affected rows in the operation to this PgResult.
    # @return [Fixnum] the count of affected rows.
    def updated_count
      if !block_given?
        return @j_del.java_method(:updatedCount, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling updated_count()"
    end
    #  Get the names of columns in the PgResult.
    # @return [Array] the list of names of columns.
    def columns_names
      if !block_given?
        return @j_del.java_method(:columnsNames, []).call().to_a.map { |elt| elt }
      end
      raise ArgumentError, "Invalid arguments when calling columns_names()"
    end
    #  Get the number of rows in the PgResult.
    # @return [Fixnum] the count of rows.
    def size
      if !block_given?
        return @j_del.java_method(:size, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling size()"
    end
    #  Get the iterator of the PgResult.
    # @return [::VertxPgClient::PgIterator] the iterator.
    def iterator
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:iterator, []).call(),::VertxPgClient::PgIterator, nil)
      end
      raise ArgumentError, "Invalid arguments when calling iterator()"
    end
    #  Return the next available result or null, e.g for a simple query that executed multiple queries or for
    #  a batch result.
    # @return [::VertxPgClient::PgResult] the next available result or null if none is available
    def next
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:next, []).call(),::VertxPgClient::PgResult, nil)
      end
      raise ArgumentError, "Invalid arguments when calling next()"
    end
  end
end




© 2015 - 2024 Weber Informatics LLC | Privacy Policy