Package org.serviceconnector.util
Class URLString
java.lang.Object
org.serviceconnector.util.URLString
The Class URLString supports the following format:
key1=value1&key2=value2&... All keys and values url encoded (see URLEncoder) using default encoding The parse
Method decodes a given string using url decoding (see URLDecoder using default encoding This class is not synchronized.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the call key.Gets the parameter map.Gets the response parameters.getParamValue(String key) Gets the value for given key if found or null.voidparseRequestURLString(String encodedString) Parses the request url string.voidparseResponseURLString(String encodedString) Parses the url encoded parameter string into this instance.voidPut key and value, if same key exists then replace its value.voidsetCallKey(String callKey) Sets the call key.toString()return url encoded stringcallKey=parameter1¶meter2¶meter3&...static StringtoURLRequestString(String... parameters) To url request string.static StringtoURLResponseString(String... parameters) Converts the key value map into a URL response string.static StringtoURLResponseString(Map<String, String> responseParameter) Converts the key value map into a URL response string.
-
Constructor Details
-
URLString
public URLString()Instantiates a new URL response string.
-
-
Method Details
-
getParamValue
Gets the value for given key if found or null.- Parameters:
key- the key- Returns:
- the value
-
getParameterSet
Gets the response parameters.- Returns:
- the entries
-
getParameterMap
Gets the parameter map.- Returns:
- the parameter map
-
putParam
Put key and value, if same key exists then replace its value.- Parameters:
key- the keyvalue- the value
-
getCallKey
Gets the call key.- Returns:
- the call key
-
setCallKey
Sets the call key.- Parameters:
callKey- the new call key
-
parseResponseURLString
Parses the url encoded parameter string into this instance.- Parameters:
encodedString- the encoded string- Throws:
UnsupportedEncodingException- the unsupported encoding exception
-
parseRequestURLString
Parses the request url string.- Parameters:
encodedString- the encoded string- Throws:
UnsupportedEncodingException- the unsupported encoding exception
-
toString
return url encoded stringcallKey=parameter1¶meter2¶meter3&... -
toURLResponseString
Converts the key value map into a URL response string.- Parameters:
parameters- the parameters- Returns:
- the string
- Throws:
UnsupportedEncodingException- the unsupported encoding exception
-
toURLResponseString
public static String toURLResponseString(Map<String, String> responseParameter) throws UnsupportedEncodingExceptionConverts the key value map into a URL response string.- Parameters:
responseParameter- the response parameter- Returns:
- the string
- Throws:
UnsupportedEncodingException- the unsupported encoding exception
-
toURLRequestString
To url request string.- Parameters:
parameters- the parameters- Returns:
- the string
- Throws:
UnsupportedEncodingException- the unsupported encoding exception
-