Class List Method List File List

# Class: VertxCassandra::MappingManager

Inherits:
  Object
  - Object
  - VertxCassandra::MappingManager
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-cassandra/mapping_manager.rb

## Overview

It is like , but adapted for Vert.x.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxCassandra::MappingManager) create(client = nil)
  Create a MappingManager from the given CassandraClient.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (::VertxCassandra::Mapper) mapper(mappedClass = nil)
  Create a Mapper that allows conversion of domain classes to and from query results.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    19
    20
    21
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-cassandra/mapping_manager.rb', line 19

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

### + (`::VertxCassandra::MappingManager`) create(client = nil)

Create a VertxCassandra::MappingManager from the given CassandraClient.

Parameters:

- client (`::VertxCassandra::CassandraClient`) (defaults to: `nil`) —
  a Cassandra client instance

Returns:

- (`::VertxCassandra::MappingManager`)

Raises:

- (`ArgumentError`)

    37
    38
    39
    40
    41
    42
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-cassandra/mapping_manager.rb', line 37

    def self.create(client=nil)
      if client.class.method_defined?(:j_del) && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCassandra::MappingManager.java_method(:create, [Java::IoVertxCassandra::CassandraClient.java_class]).call(client.j_del),::VertxCassandra::MappingManager)
      end
      raise ArgumentError, "Invalid arguments when calling create(#{client})"
    end

### + (`Object`) j_api_type

    28
    29
    30
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-cassandra/mapping_manager.rb', line 28

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    31
    32
    33
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-cassandra/mapping_manager.rb', line 31

    def self.j_class
      Java::IoVertxCassandra::MappingManager.java_class
    end

### + (`Object`) unwrap(obj)

    25
    26
    27
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-cassandra/mapping_manager.rb', line 25

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

### + (`Object`) wrap(obj)

    22
    23
    24
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-cassandra/mapping_manager.rb', line 22

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

## Instance Method Details

### - (`::VertxCassandra::Mapper`) mapper(mappedClass = nil)

Create a VertxCassandra::Mapper that allows conversion of domain classes to and from query results.

Parameters:

- mappedClass (`Nil`) (defaults to: `nil`) —
  mapped class

Returns:

- (`::VertxCassandra::Mapper`)

Raises:

- (`ArgumentError`)

    46
    47
    48
    49
    50
    51
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-cassandra/mapping_manager.rb', line 46

    def mapper(mappedClass=nil)
      if mappedClass.class == Class && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:mapper, [Java::JavaLang::Class.java_class]).call(::Vertx::Util::Utils.j_class_of(mappedClass)),::VertxCassandra::Mapper, ::Vertx::Util::Utils.v_type_of(mappedClass))
      end
      raise ArgumentError, "Invalid arguments when calling mapper(#{mappedClass})"
    end