Package com.easypost.utils
Class InternalUtilities
java.lang.Object
com.easypost.utils.InternalUtilities
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetEncodedURL(Map<String, String> params, String parentKey) Create Encoded URL from a Map.static <TElement> TElementgetOrDefault(Map<String, Object> map, String key, TElement defaultValue) Extract a value from a Map, or return a default value if the key is not present. 
- 
Constructor Details
- 
InternalUtilities
public InternalUtilities() 
 - 
 - 
Method Details
- 
getEncodedURL
public static String getEncodedURL(Map<String, String> params, String parentKey) throws EncodingErrorCreate Encoded URL from a Map.- Parameters:
 params- Map of parameters to be encoded.parentKey- Parent key in the encoded URL.- Returns:
 - Encoded URL for Stripe API call.
 - Throws:
 EncodingError- when the URL encoding fails.
 - 
getOrDefault
public static <TElement> TElement getOrDefault(Map<String, Object> map, String key, TElement defaultValue) Extract a value from a Map, or return a default value if the key is not present.- Type Parameters:
 TElement- Type of the value to extract- Parameters:
 map- Map to extract fromkey- Key to extractdefaultValue- Default value to return if the key is not present- Returns:
 - Value from the map, or the default value if the key is not present
 
 
 -