Module: VertxWeb::ParsedHeaderValue

Included in:
LanguageHeader, MIMEHeader, ParsedHeaderValueImpl
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_value.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) DEFAULT_WEIGHT

If no "q" parameter is present, the default weight is 1.


123
124
125
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_value.rb', line 123

def self.DEFAULT_WEIGHT
  Java::IoVertxExtWeb::ParsedHeaderValue.DEFAULT_WEIGHT
end

Instance Method Details

- (true, false) isMatchedBy(matchTry)

Test if this header is matched by matchTry header

Parameters:

Returns:

  • (true, false)
    true if this header represents a subset of matchTry, otherwise, false


112
113
114
115
116
117
118
119
120
121
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_value.rb', line 112

def matched_by?(*args)
  if args[0].class.method_defined?(:j_del) && !block_given?
    return @j_del.java_method(:isMatchedBy, [Java::IoVertxExtWeb::ParsedHeaderValue.java_class]).call(args[0].j_del)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling matched_by?(#{args[0]})"
  end
end

- (String) parameter(key)

The value of the parameter specified by this key. Each is one of 3 things:
  1. null <- That key was not specified
  2. ParsedHeaderValue.EMPTY (tested using ==) <- The value was not specified
  3. [Other] <- The value of the parameter
Note: The q parameter is never present.

Parameters:

  • key (String)

Returns:

  • (String)


55
56
57
58
59
60
61
62
63
64
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_value.rb', line 55

def parameter(*args)
  if args[0].class == String && !block_given?
    return @j_del.java_method(:parameter, [Java::java.lang.String.java_class]).call(args[0])
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling parameter(#{args[0]})"
  end
end

- (Hash{String => String}) parameters

The parameters specified in this header value. Note: The q parameter is never present.

Returns:

  • (Hash{String => String})
    Unmodifiable Map of parameters of this header value


84
85
86
87
88
89
90
91
92
93
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_value.rb', line 84

def parameters
  if !block_given?
    return Java::IoVertxLangRuby::Helper.adaptingMap(@j_del.java_method(:parameters, []).call(), Proc.new { |val| val }, Proc.new { |val| ::Vertx::Util::Utils.to_string(val) })
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling parameters()"
  end
end

- (true, false) isPermitted

Is this an allowed operation as specified by the corresponding header?

Returns:

  • (true, false)


35
36
37
38
39
40
41
42
43
44
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_value.rb', line 35

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

- (String) rawValue

Contains the raw value that was received from the user agent

Returns:

  • (String)


22
23
24
25
26
27
28
29
30
31
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_value.rb', line 22

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

- (String) value

Holds the unparsed value of the header.
For the most part, this is the content before the semi-colon (";")

Returns:

  • (String)


98
99
100
101
102
103
104
105
106
107
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_value.rb', line 98

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

- (Float) weight

Holds the weight specified in the "q" parameter of the header.
If the parameter is not specified, 1.0 is assumed according to rfc7231

Returns:

  • (Float)


70
71
72
73
74
75
76
77
78
79
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_value.rb', line 70

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

- (Fixnum) weightedOrder

An integer that represents the absolute order position of this header

Returns:

  • (Fixnum)


9
10
11
12
13
14
15
16
17
18
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/parsed_header_value.rb', line 9

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