Class QueryTemplate


  • public final class QueryTemplate
    extends Template
    Template for a Query String parameter.
    • Method Detail

      • create

        public static QueryTemplate create​(java.lang.String name,
                                           java.lang.Iterable<java.lang.String> values,
                                           java.nio.charset.Charset charset)
        Create a new Query Template.
        Parameters:
        name - of the query parameter.
        values - in the template.
        charset - for the template.
        Returns:
        a QueryTemplate.
      • create

        public static QueryTemplate create​(java.lang.String name,
                                           java.lang.Iterable<java.lang.String> values,
                                           java.nio.charset.Charset charset,
                                           CollectionFormat collectionFormat)
        Create a new Query Template.
        Parameters:
        name - of the query parameter.
        values - in the template.
        charset - for the template.
        collectionFormat - to use.
        Returns:
        a QueryTemplate
      • append

        public static QueryTemplate append​(QueryTemplate queryTemplate,
                                           java.lang.Iterable<java.lang.String> values,
                                           CollectionFormat collectionFormat)
        Append a value to the Query Template.
        Parameters:
        queryTemplate - to append to.
        values - to append.
        Returns:
        a new QueryTemplate with value appended.
      • getValues

        public java.util.List<java.lang.String> getValues()
      • getName

        public java.lang.String getName()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Template
      • expand

        public java.lang.String expand​(java.util.Map<java.lang.String,​?> variables)
        Expand this template. Unresolved variables are removed. If all values remain unresolved, the result is an empty string.
        Overrides:
        expand in class Template
        Parameters:
        variables - containing the values for expansion.
        Returns:
        the expanded template.