com.github.kristofa.test.http
Class QueryParameter

java.lang.Object
  extended by com.github.kristofa.test.http.QueryParameter
All Implemented Interfaces:
Comparable<QueryParameter>

public class QueryParameter
extends Object
implements Comparable<QueryParameter>

Defines a query parameter key/value.

In following url: http://localhost:8081/persons?name=Smith&gender=female there are 2 query parameters: name=Smith and gender=female.

Author:
kristof

Constructor Summary
QueryParameter(String key, String value)
          Creates a new instance.
 
Method Summary
 int compareTo(QueryParameter o)
          
 boolean equals(Object obj)
          
 String getKey()
          Gets key.
 String getValue()
          Gets value for key.
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryParameter

public QueryParameter(String key,
                      String value)
Creates a new instance.

Parameters:
key - Key, should not be empty.
value - Value, should not be empty.
Method Detail

getKey

public String getKey()
Gets key.

Returns:
Key.

getValue

public String getValue()
Gets value for key.

Returns:
Value for key.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

toString

public String toString()

Overrides:
toString in class Object

compareTo

public int compareTo(QueryParameter o)

Specified by:
compareTo in interface Comparable<QueryParameter>


Copyright © 2014. All Rights Reserved.