Class List Method List File List

# Class: VertxWeb::BridgeEvent

Inherits:
  Vertx::Future
  - Object
  - Vertx::Future
  - VertxWeb::BridgeEvent
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb

## Instance Method Summary (collapse)

- - (Object) cause
- - (Object) complete(arg0 = nil)
- - (Boolean) complete?
- - (Object) completer
- - (Object) compose(param_1 = nil, param_2 = nil)
- - (Object) fail(param_1 = nil)
- - (Boolean) failed?
- - (Object) get_raw_message
- - (BridgeEvent) initialize(j_del) constructor
  A new instance of BridgeEvent.
- - (Object) j_del
- - (Object) map(param_1 = nil)
- - (Object) raw_message
- - (Boolean) result?
- - (Object) set_handler
- - (Object) set_raw_message(message = nil)
- - (Object) socket
- - (Boolean) succeeded?
- - (Object) type

### Methods inherited from Vertx::Future

failed_future, future, #result, succeeded_future

## Constructor Details

### - (`BridgeEvent`) initialize(j_del)

Returns a new instance of BridgeEvent

    12
    13
    14
    15
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 12

    def initialize(j_del)
      super(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) cause

Raises:

- (`ArgumentError`)

    68
    69
    70
    71
    72
    73
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 68

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

### - (`Object`) complete(arg0 = nil)

Raises:

- (`ArgumentError`)

    39
    40
    41
    42
    43
    44
    45
    46
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 39

    def complete(arg0=nil)
      if !block_given? && arg0 == nil
        return @j_del.java_method(:complete, []).call()
      elsif (arg0.class == TrueClass || arg0.class == FalseClass) && !block_given?
        return @j_del.java_method(:complete, [Java::JavaLang::Boolean.java_class]).call(arg0)
      end
      raise ArgumentError, "Invalid arguments when calling complete(arg0)"
    end

### - (`Boolean`) complete?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    22
    23
    24
    25
    26
    27
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 22

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

### - (`Object`) completer

Raises:

- (`ArgumentError`)

    116
    117
    118
    119
    120
    121
    122
    123
    124
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 116

    def completer
      if !block_given?
        if @cached_completer != nil
          return @cached_completer
        end
        return @cached_completer = ::Vertx::Util::Utils.to_async_result_handler_proc(@j_del.java_method(:completer, []).call()) { |val| val }
      end
      raise ArgumentError, "Invalid arguments when calling completer()"
    end

### - (`Object`) compose(param_1 = nil, param_2 = nil)

Raises:

- (`ArgumentError`)

    94
    95
    96
    97
    98
    99
    100
    101
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 94

    def compose(param_1=nil,param_2=nil)
      if block_given? && param_1 == nil && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:compose, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| yield(event).j_del })),::Vertx::Future)
      elsif param_1.class == Proc && param_2.class.method_defined?(:j_del) && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:compose, [Java::IoVertxCore::Handler.java_class,Java::IoVertxCore::Future.java_class]).call((Proc.new { |event| param_1.call(event) }),param_2.j_del),::Vertx::Future)
      end
      raise ArgumentError, "Invalid arguments when calling compose(param_1,param_2)"
    end

### - (`Object`) fail(param_1 = nil)

Raises:

- (`ArgumentError`)

    52
    53
    54
    55
    56
    57
    58
    59
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 52

    def fail(param_1=nil)
      if param_1.is_a?(Exception) && !block_given?
        return @j_del.java_method(:fail, [Java::JavaLang::Throwable.java_class]).call(::Vertx::Util::Utils.to_throwable(param_1))
      elsif param_1.class == String && !block_given?
        return @j_del.java_method(:fail, [Java::java.lang.String.java_class]).call(param_1)
      end
      raise ArgumentError, "Invalid arguments when calling fail(param_1)"
    end

### - (`Boolean`) failed?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    82
    83
    84
    85
    86
    87
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 82

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

### - (`Object`) get_raw_message

Raises:

- (`ArgumentError`)

    150
    151
    152
    153
    154
    155
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 150

    def get_raw_message
      if !block_given?
        return @j_del.java_method(:getRawMessage, []).call() != nil ? JSON.parse(@j_del.java_method(:getRawMessage, []).call().encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling get_raw_message()"
    end

### - (`Object`) j_del

    18
    19
    20
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 18

    def j_del
      @j_del
    end

### - (`Object`) map(param_1 = nil)

Raises:

- (`ArgumentError`)

    107
    108
    109
    110
    111
    112
    113
    114
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 107

    def map(param_1=nil)
      if block_given? && param_1 == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:map, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| ::Vertx::Util::Utils.to_object(yield(event)) })),::Vertx::Future)
      elsif (param_1.class == String  || param_1.class == Hash || param_1.class == Array || param_1.class == NilClass || param_1.class == TrueClass || param_1.class == FalseClass || param_1.class == Fixnum || param_1.class == Float) && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:map, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(param_1)),::Vertx::Future)
      end
      raise ArgumentError, "Invalid arguments when calling map(param_1)"
    end

### - (`Object`) raw_message

Raises:

- (`ArgumentError`)

    137
    138
    139
    140
    141
    142
    143
    144
    145
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 137

    def raw_message
      if !block_given?
        if @cached_raw_message != nil
          return @cached_raw_message
        end
        return @cached_raw_message = @j_del.java_method(:rawMessage, []).call() != nil ? JSON.parse(@j_del.java_method(:rawMessage, []).call().encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling raw_message()"
    end

### - (`Boolean`) result?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    61
    62
    63
    64
    65
    66
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 61

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

### - (`Object`) set_handler

Raises:

- (`ArgumentError`)

    30
    31
    32
    33
    34
    35
    36
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 30

    def set_handler
      if block_given?
        @j_del.java_method(:setHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_handler()"
    end

### - (`Object`) set_raw_message(message = nil)

Raises:

- (`ArgumentError`)

    160
    161
    162
    163
    164
    165
    166
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 160

    def set_raw_message(message=nil)
      if message.class == Hash && !block_given?
        @j_del.java_method(:setRawMessage, [Java::IoVertxCoreJson::JsonObject.java_class]).call(::Vertx::Util::Utils.to_json_object(message))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_raw_message(message)"
    end

### - (`Object`) socket

Raises:

- (`ArgumentError`)

    169
    170
    171
    172
    173
    174
    175
    176
    177
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 169

    def socket
      if !block_given?
        if @cached_socket != nil
          return @cached_socket
        end
        return @cached_socket = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:socket, []).call(),::VertxWeb::SockJSSocket)
      end
      raise ArgumentError, "Invalid arguments when calling socket()"
    end

### - (`Boolean`) succeeded?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    75
    76
    77
    78
    79
    80
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 75

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

### - (`Object`) type

Raises:

- (`ArgumentError`)

    126
    127
    128
    129
    130
    131
    132
    133
    134
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/bridge_event.rb', line 126

    def type
      if !block_given?
        if @cached_type != nil
          return @cached_type
        end
        return @cached_type = @j_del.java_method(:type, []).call().name.intern
      end
      raise ArgumentError, "Invalid arguments when calling type()"
    end