citysdk.tourism.client.requests
Class Parameter

java.lang.Object
  extended by citysdk.tourism.client.requests.Parameter

public class Parameter
extends java.lang.Object

It is used to indicate what parameters should the URI have upon a HTTP request. Its term should be one of the terms shown in ParameterTerms or it will throw an InvalidParameterException and its value should be the search value.

Author:
Pedro Cruz

Constructor Summary
Parameter(ParameterTerms term, java.lang.Object value)
          Constructor first validates the name before actually creating the Parameter.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 ParameterTerms getParameterTerm()
           
 java.lang.String getTerm()
           
 java.lang.Object getValue()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter(ParameterTerms term,
                 java.lang.Object value)
          throws InvalidParameterException,
                 InvalidValueException
Constructor first validates the name before actually creating the Parameter. Its validation verifies if it is one of the terms found in ParameterTerms. If it is not found in the aforementioned enum, then it will throw an InvalidParameterException.

Parameters:
term - the term of the parameter
value - the value of the parameter used for search. It can be either a primitive class (Number, CharSequence or Boolean) implementing toString() or a Collection or a Map.
Throws:
InvalidParameterException - thrown if the parameter term is invalid
InvalidValueException - thrown if value is not one of the mentioned classes
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getParameterTerm

public ParameterTerms getParameterTerm()

getTerm

public java.lang.String getTerm()

getValue

public java.lang.Object getValue()