Class Params

  • Direct Known Subclasses:
    HttpQuery

    public class Params
    extends java.lang.Object
    A collection of parameters for protocol use.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Params.Pair  
    • Constructor Summary

      Constructors 
      Constructor Description
      Params()
      Create a Params object
      Params​(Params other)
      Create a Params object, initialized from another one.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addParam​(java.lang.String name)
      Valueless parameter
      Params addParam​(java.lang.String name, java.lang.String value)
      Add a parameter.
      boolean containsParam​(java.lang.String name)  
      int count()  
      java.lang.String getValue​(java.lang.String name)  
      java.util.List<java.lang.String> getValues​(java.lang.String name)  
      java.lang.String httpString()
      Query string, without leading "?"
      void merge​(Params other)  
      java.util.List<java.lang.String> names()
      Get the names of parameters - one occurrence
      java.util.List<Params.Pair> pairs()
      Exactly as seen
      void remove​(java.lang.String name)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Params

        public Params()
        Create a Params object
      • Params

        public Params​(Params other)
        Create a Params object, initialized from another one. A copy is made so the initial values of the Params object are as of the time this constructor was called.
        Parameters:
        other -
    • Method Detail

      • merge

        public void merge​(Params other)
      • addParam

        public Params addParam​(java.lang.String name,
                               java.lang.String value)
        Add a parameter.
        Parameters:
        name - Name of the parameter
        value - Value - May be null to indicate none - the name still goes.
        Returns:
        this Params for continued operation
      • addParam

        public void addParam​(java.lang.String name)
        Valueless parameter
      • containsParam

        public boolean containsParam​(java.lang.String name)
      • getValue

        public java.lang.String getValue​(java.lang.String name)
      • getValues

        public java.util.List<java.lang.String> getValues​(java.lang.String name)
      • remove

        public void remove​(java.lang.String name)
      • pairs

        public java.util.List<Params.Pair> pairs()
        Exactly as seen
      • count

        public int count()
      • names

        public java.util.List<java.lang.String> names()
        Get the names of parameters - one occurrence
      • httpString

        public java.lang.String httpString()
        Query string, without leading "?"
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object