Module: VertxWeb::ParsedHeaderValue

Included in:
LanguageHeader, MIMEHeader, ParsedHeaderValueImpl
Defined in:
/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/parsed_header_value.rb

Instance Method Summary (collapse)

Instance Method Details

- (true, false) matched_by?(matchTry = nil)

Test if this header is matched by matchTry header

Parameters:

Returns:

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

Raises:

  • (ArgumentError)


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

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

- (String) parameter(key = nil)

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) (defaults to: nil)

Returns:

  • (String)

Raises:

  • (ArgumentError)


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

def parameter(key=nil)
  if key.class == String && !block_given?
    return @j_del.java_method(:parameter, [Java::java.lang.String.java_class]).call(key)
  end
  raise ArgumentError, "Invalid arguments when calling parameter(#{key})"
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

Raises:

  • (ArgumentError)


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

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

- (true, false) permitted?

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

Returns:

  • (true, false)

Raises:

  • (ArgumentError)


58
59
60
61
62
63
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/parsed_header_value.rb', line 58

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

- (String) raw_value

Contains the raw value that was received from the user agent

Returns:

  • (String)

Raises:

  • (ArgumentError)


7
8
9
10
11
12
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/parsed_header_value.rb', line 7

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

- (String) value

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

Returns:

  • (String)

Raises:

  • (ArgumentError)


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

def value
  if !block_given?
    return @j_del.java_method(:value, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling value()"
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)

Raises:

  • (ArgumentError)


26
27
28
29
30
31
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/parsed_header_value.rb', line 26

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

- (Fixnum) weighted_order

An integer that represents the absolute order position of this header

Returns:

  • (Fixnum)

Raises:

  • (ArgumentError)


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

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