Class Variables

java.lang.Object
io.vertx.mutiny.uritemplate.Variables
All Implemented Interfaces:
MutinyDelegate

public class Variables extends Object implements MutinyDelegate
Holds a set of name/value pairs where each value can be a String or a List<String> or a Map<String, String>.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

See Also:
  • Variables
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TypeArg<Variables>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Variables(io.vertx.uritemplate.Variables delegate)
    Create a new instance of Variables delegating to the given (non-null) instance of Variables.
    Variables(Object delegate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    addAll(io.vertx.core.json.JsonObject json)
    Populates with a JSON object: null are conserved JsonArray is converted to List<String> JsonObject is converted to Map<String, String> any other value is converted to a string Note that nested JSON elements are converted to a string, so { "user": { "first_name": "John", "last_name": "Doe", "address" : { "city": "Paris", etc... } } } flattens the JSON "address" to the string "{\"city\":\"Paris\",etc...}".
     
    boolean
     
    get(String name)
     
    io.vertx.uritemplate.Variables
    Get the delegate instance.
     
    getMap(String name)
     
     
    int
     
     
    static Variables
    newInstance(io.vertx.uritemplate.Variables delegate)
    Creates a new instance of the Variables.
    set(String name, String value)
    Set a single variable.
    set(String name, List<String> value)
    Set a list variable.
    set(String name, Map<String,String> value)
    Set a map variable.
    setAll(io.vertx.core.json.JsonObject json)
    Like addAll(JsonObject) but overwrites previous variables.
     
    static Variables
     
    static Variables
    variables(io.vertx.core.json.JsonObject json)
    Create an instance populated from a JSON object: null are conserved JsonArray is converted to List<String> JsonObject is converted to Map<String, String> any other value is converted to a string Note that nested JSON elements are converted to a string, so { "user": { "first_name": "John", "last_name": "Doe", "address" : { "city": "Paris", etc... } } } flattens the JSON "address" to the string "{\"city\":\"Paris\",etc...}".

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • Variables

      public Variables(io.vertx.uritemplate.Variables delegate)
      Create a new instance of Variables delegating to the given (non-null) instance of Variables.
    • Variables

      public Variables(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.uritemplate.Variables getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • variables

      public static Variables variables()
      Returns:
      an empty instance
    • variables

      public static Variables variables(io.vertx.core.json.JsonObject json)
      Create an instance populated from a JSON object:
      • null are conserved
      • JsonArray is converted to List<String>
      • JsonObject is converted to Map<String, String>
      • any other value is converted to a string
      Note that nested JSON elements are converted to a string, so { "user": { "first_name": "John", "last_name": "Doe", "address" : { "city": "Paris", etc... } } } flattens the JSON "address" to the string "{\"city\":\"Paris\",etc...}".
      Parameters:
      json - the json that populates the returned variables
      Returns:
      an instance populated from a JSON object
    • set

      public Variables set(String name, String value)
      Set a single variable.
      Parameters:
      name - the variable name
      value - the variable value
      Returns:
      a reference to this, so the API can be used fluently
    • set

      public Variables set(String name, List<String> value)
      Set a list variable.
      Parameters:
      name - the variable name
      value - the variable value
      Returns:
      a reference to this, so the API can be used fluently
    • set

      public Variables set(String name, Map<String,String> value)
      Set a map variable.
      Parameters:
      name - the variable name
      value - the variable value
      Returns:
      a reference to this, so the API can be used fluently
    • setAll

      public Variables setAll(io.vertx.core.json.JsonObject json)
      Like addAll(JsonObject) but overwrites previous variables.
    • addAll

      public Variables addAll(io.vertx.core.json.JsonObject json)
      Populates with a JSON object:
      • null are conserved
      • JsonArray is converted to List<String>
      • JsonObject is converted to Map<String, String>
      • any other value is converted to a string
      Note that nested JSON elements are converted to a string, so { "user": { "first_name": "John", "last_name": "Doe", "address" : { "city": "Paris", etc... } } } flattens the JSON "address" to the string "{\"city\":\"Paris\",etc...}".
      Parameters:
      json - the json that populates the returned variables
      Returns:
      a reference to this, so the API can be used fluently
    • clear

      public Variables clear()
    • names

      public Set<String> names()
      Returns:
      the set of variable names
    • get

      public Object get(String name)
      Returns:
      the value of the variable name
    • getSingle

      public String getSingle(String name)
      Returns:
      the single value of the variable name
    • getList

      public List<String> getList(String name)
      Returns:
      the list value of the variable name
    • getMap

      public Map<String,String> getMap(String name)
      Returns:
      the map value of the variable name
    • newInstance

      public static Variables newInstance(io.vertx.uritemplate.Variables delegate)
      Creates a new instance of the Variables.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object