Class List Method List File List

# Class: VertxWebClient::ResponsePredicateResult

Inherits:
  Object
  - Object
  - VertxWebClient::ResponsePredicateResult
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate_result.rb

## Overview

Represents the outcome of a ResponsePredicate applied to an .

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxWebClient::ResponsePredicateResult) failure(message = nil)
  Creates a failed result.
- + (Object) j_api_type
- + (Object) j_class
- + (::VertxWebClient::ResponsePredicateResult) success
  A successful result.
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (String) message
  The failure message.
- - (::VertxWebClient::HttpResponse) response
  The which has been tested.
- - (true, false) succeeded?
  Whether the result is a success or failure.

## 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-web-client/response_predicate_result.rb', line 19

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

### + (`::VertxWebClient::ResponsePredicateResult`) failure(message = nil)

Creates a failed result.

Parameters:

- message (`String`) (defaults to: `nil`) —
  the failure description

Returns:

- (`::VertxWebClient::ResponsePredicateResult`)

Raises:

- (`ArgumentError`)

    44
    45
    46
    47
    48
    49
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate_result.rb', line 44

    def self.failure(message=nil)
      if message.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicateResult.java_method(:failure, [Java::java.lang.String.java_class]).call(message),::VertxWebClient::ResponsePredicateResult)
      end
      raise ArgumentError, "Invalid arguments when calling failure(#{message})"
    end

### + (`Object`) j_api_type

    28
    29
    30
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate_result.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-web-client/response_predicate_result.rb', line 31

    def self.j_class
      Java::IoVertxExtWebClientPredicate::ResponsePredicateResult.java_class
    end

### + (`::VertxWebClient::ResponsePredicateResult`) success

Returns a successful result

Returns:

- (`::VertxWebClient::ResponsePredicateResult`) —
  a successful result

Raises:

- (`ArgumentError`)

    35
    36
    37
    38
    39
    40
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate_result.rb', line 35

    def self.success
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebClientPredicate::ResponsePredicateResult.java_method(:success, []).call(),::VertxWebClient::ResponsePredicateResult)
      end
      raise ArgumentError, "Invalid arguments when calling success()"
    end

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

    25
    26
    27
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate_result.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-web-client/response_predicate_result.rb', line 22

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

## Instance Method Details

### - (`String`) message

The failure message. May be `null`.

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

    60
    61
    62
    63
    64
    65
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate_result.rb', line 60

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

### - (`::VertxWebClient::HttpResponse`) response

The which has been tested.

Returns:

- (`::VertxWebClient::HttpResponse`) —
  `null` after the result has been created, or the tested response for converters created with ErrorConverter#create_full_body

Raises:

- (`ArgumentError`)

    68
    69
    70
    71
    72
    73
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate_result.rb', line 68

    def response
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:response, []).call(),::VertxWebClient::HttpResponse,::Vertx::Buffer.j_api_type)
      end
      raise ArgumentError, "Invalid arguments when calling response()"
    end

### - (`true`, `false`) succeeded?

Whether the result is a success or failure.

Returns:

- (`true`, `false`) —
  `true` if the VertxWebClient::ResponsePredicate was applied successfully, false otherwise

Raises:

- (`ArgumentError`)

    52
    53
    54
    55
    56
    57
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-client/response_predicate_result.rb', line 52

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