Class List Method List File List

# Class: Vertx::CLI

Inherits:
  Object
  - Object
  - Vertx::CLI
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb

## Class Method Summary (collapse)

- + (Object) create(name = nil)

## Instance Method Summary (collapse)

- - (Object) add_argument(arg = nil)
- - (Object) add_arguments(args = nil)
- - (Object) add_option(option = nil)
- - (Object) add_options(options = nil)
- - (Object) get_argument(param_1 = nil)
- - (Object) get_arguments
- - (Object) get_description
- - (Object) get_name
- - (Object) get_option(name = nil)
- - (Object) get_options
- - (Object) get_summary
- - (Boolean) hidden?
- - (CLI) initialize(j_del) constructor
  A new instance of CLI.
- - (Object) j_del
- - (Object) parse(arguments = nil, validate = nil)
- - (Object) remove_argument(index = nil)
- - (Object) remove_option(name = nil)
- - (Object) set_arguments(args = nil)
- - (Object) set_description(desc = nil)
- - (Object) set_hidden(hidden = nil)
- - (Object) set_name(name = nil)
- - (Object) set_options(options = nil)
- - (Object) set_summary(summary = nil)

## Constructor Details

### - (`CLI`) initialize(j_del)

Returns a new instance of CLI

    21
    22
    23
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 21

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) create(name = nil)

Raises:

- (`ArgumentError`)

    32
    33
    34
    35
    36
    37
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 32

    def self.create(name=nil)
      if name.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCoreCli::CLI.java_method(:create, [Java::java.lang.String.java_class]).call(name),::Vertx::CLI)
      end
      raise ArgumentError, "Invalid arguments when calling create(name)"
    end

## Instance Method Details

### - (`Object`) add_argument(arg = nil)

Raises:

- (`ArgumentError`)

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

    def add_argument(arg=nil)
      if arg.class == Hash && !block_given?
        @j_del.java_method(:addArgument, [Java::IoVertxCoreCli::Argument.java_class]).call(Java::IoVertxCoreCli::Argument.new(::Vertx::Util::Utils.to_json_object(arg)))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling add_argument(arg)"
    end

### - (`Object`) add_arguments(args = nil)

Raises:

- (`ArgumentError`)

    180
    181
    182
    183
    184
    185
    186
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 180

    def add_arguments(args=nil)
      if args.class == Array && !block_given?
        @j_del.java_method(:addArguments, [Java::JavaUtil::List.java_class]).call(args.map { |element| Java::IoVertxCoreCli::Argument.new(::Vertx::Util::Utils.to_json_object(element)) })
        return self
      end
      raise ArgumentError, "Invalid arguments when calling add_arguments(args)"
    end

### - (`Object`) add_option(option = nil)

Raises:

- (`ArgumentError`)

    130
    131
    132
    133
    134
    135
    136
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 130

    def add_option(option=nil)
      if option.class == Hash && !block_given?
        @j_del.java_method(:addOption, [Java::IoVertxCoreCli::Option.java_class]).call(Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(option)))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling add_option(option)"
    end

### - (`Object`) add_options(options = nil)

Raises:

- (`ArgumentError`)

    141
    142
    143
    144
    145
    146
    147
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 141

    def add_options(options=nil)
      if options.class == Array && !block_given?
        @j_del.java_method(:addOptions, [Java::JavaUtil::List.java_class]).call(options.map { |element| Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(element)) })
        return self
      end
      raise ArgumentError, "Invalid arguments when calling add_options(options)"
    end

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

Raises:

- (`ArgumentError`)

    212
    213
    214
    215
    216
    217
    218
    219
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 212

    def get_argument(param_1=nil)
      if param_1.class == String && !block_given?
        return @j_del.java_method(:getArgument, [Java::java.lang.String.java_class]).call(param_1) != nil ? JSON.parse(@j_del.java_method(:getArgument, [Java::java.lang.String.java_class]).call(param_1).toJson.encode) : nil
      elsif param_1.class == Fixnum && !block_given?
        return @j_del.java_method(:getArgument, [Java::int.java_class]).call(param_1) != nil ? JSON.parse(@j_del.java_method(:getArgument, [Java::int.java_class]).call(param_1).toJson.encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling get_argument(param_1)"
    end

### - (`Object`) get_arguments

Raises:

- (`ArgumentError`)

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

    def get_arguments
      if !block_given?
        return @j_del.java_method(:getArguments, []).call().to_a.map { |elt| elt != nil ? JSON.parse(elt.toJson.encode) : nil }
      end
      raise ArgumentError, "Invalid arguments when calling get_arguments()"
    end

### - (`Object`) get_description

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) get_name

Raises:

- (`ArgumentError`)

    51
    52
    53
    54
    55
    56
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 51

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

### - (`Object`) get_option(name = nil)

Raises:

- (`ArgumentError`)

    200
    201
    202
    203
    204
    205
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 200

    def get_option(name=nil)
      if name.class == String && !block_given?
        return @j_del.java_method(:getOption, [Java::java.lang.String.java_class]).call(name) != nil ? JSON.parse(@j_del.java_method(:getOption, [Java::java.lang.String.java_class]).call(name).toJson.encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling get_option(name)"
    end

### - (`Object`) get_options

Raises:

- (`ArgumentError`)

    121
    122
    123
    124
    125
    126
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 121

    def get_options
      if !block_given?
        return @j_del.java_method(:getOptions, []).call().to_a.map { |elt| elt != nil ? JSON.parse(elt.toJson.encode) : nil }
      end
      raise ArgumentError, "Invalid arguments when calling get_options()"
    end

### - (`Object`) get_summary

Raises:

- (`ArgumentError`)

    84
    85
    86
    87
    88
    89
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 84

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

### - (`Boolean`) hidden?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    102
    103
    104
    105
    106
    107
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 102

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

### - (`Object`) j_del

    26
    27
    28
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 26

    def j_del
      @j_del
    end

### - (`Object`) parse(arguments = nil, validate = nil)

Raises:

- (`ArgumentError`)

    42
    43
    44
    45
    46
    47
    48
    49
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 42

    def parse(arguments=nil,validate=nil)
      if arguments.class == Array && !block_given? && validate == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:parse, [Java::JavaUtil::List.java_class]).call(arguments.map { |element| element }),::Vertx::CommandLine)
      elsif arguments.class == Array && (validate.class == TrueClass || validate.class == FalseClass) && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:parse, [Java::JavaUtil::List.java_class,Java::boolean.java_class]).call(arguments.map { |element| element },validate),::Vertx::CommandLine)
      end
      raise ArgumentError, "Invalid arguments when calling parse(arguments,validate)"
    end

### - (`Object`) remove_argument(index = nil)

Raises:

- (`ArgumentError`)

    233
    234
    235
    236
    237
    238
    239
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 233

    def remove_argument(index=nil)
      if index.class == Fixnum && !block_given?
        @j_del.java_method(:removeArgument, [Java::int.java_class]).call(index)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling remove_argument(index)"
    end

### - (`Object`) remove_option(name = nil)

Raises:

- (`ArgumentError`)

    223
    224
    225
    226
    227
    228
    229
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 223

    def remove_option(name=nil)
      if name.class == String && !block_given?
        @j_del.java_method(:removeOption, [Java::java.lang.String.java_class]).call(name)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling remove_option(name)"
    end

### - (`Object`) set_arguments(args = nil)

Raises:

- (`ArgumentError`)

    190
    191
    192
    193
    194
    195
    196
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 190

    def set_arguments(args=nil)
      if args.class == Array && !block_given?
        @j_del.java_method(:setArguments, [Java::JavaUtil::List.java_class]).call(args.map { |element| Java::IoVertxCoreCli::Argument.new(::Vertx::Util::Utils.to_json_object(element)) })
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_arguments(args)"
    end

### - (`Object`) set_description(desc = nil)

Raises:

- (`ArgumentError`)

    76
    77
    78
    79
    80
    81
    82
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 76

    def set_description(desc=nil)
      if desc.class == String && !block_given?
        @j_del.java_method(:setDescription, [Java::java.lang.String.java_class]).call(desc)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_description(desc)"
    end

### - (`Object`) set_hidden(hidden = nil)

Raises:

- (`ArgumentError`)

    112
    113
    114
    115
    116
    117
    118
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 112

    def set_hidden(hidden=nil)
      if (hidden.class == TrueClass || hidden.class == FalseClass) && !block_given?
        @j_del.java_method(:setHidden, [Java::boolean.java_class]).call(hidden)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_hidden(hidden)"
    end

### - (`Object`) set_name(name = nil)

Raises:

- (`ArgumentError`)

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

    def set_name(name=nil)
      if name.class == String && !block_given?
        @j_del.java_method(:setName, [Java::java.lang.String.java_class]).call(name)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_name(name)"
    end

### - (`Object`) set_options(options = nil)

Raises:

- (`ArgumentError`)

    151
    152
    153
    154
    155
    156
    157
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 151

    def set_options(options=nil)
      if options.class == Array && !block_given?
        @j_del.java_method(:setOptions, [Java::JavaUtil::List.java_class]).call(options.map { |element| Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(element)) })
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_options(options)"
    end

### - (`Object`) set_summary(summary = nil)

Raises:

- (`ArgumentError`)

    93
    94
    95
    96
    97
    98
    99
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/cli.rb', line 93

    def set_summary(summary=nil)
      if summary.class == String && !block_given?
        @j_del.java_method(:setSummary, [Java::java.lang.String.java_class]).call(summary)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_summary(summary)"
    end