Package io.grpc

Class QueryParams.Entry

  • Enclosing class:
    QueryParams

    public static final class QueryParams.Entry
    extends Object
    A single query parameter entry.
    • Method Detail

      • getKey

        public String getKey()
        Returns the key.

        Any characters that needed URL encoding have already been decoded.

      • getValue

        @Nullable
        public String getValue()
        Returns the value, or null if this is a "lone" key.

        Any characters that needed URL encoding have already been decoded.

      • hasValue

        public boolean hasValue()
        Returns true if this entry has a value, false if it is a "lone" key.
      • forKeyValue

        public static QueryParams.Entry forKeyValue​(String key,
                                                    String value)
        Creates a new key/value pair entry.

        Both key and value can contain any character. They will be URL encoded for you if necessary.

      • forLoneKey

        public static QueryParams.Entry forLoneKey​(String key)
        Creates a new query parameter with a "lone" key.

        'key' can contain any character. It will be URL encoded for you later, as necessary.

        Parameters:
        key - the decoded key, must not be null
        Returns:
        a new Entry
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object