Class InternalUtilities

java.lang.Object
com.easypost.utils.InternalUtilities

public abstract class InternalUtilities extends Object
  • Constructor Details

    • InternalUtilities

      public InternalUtilities()
  • Method Details

    • getEncodedURL

      public static String getEncodedURL(Map<String,String> params, String parentKey) throws EncodingError
      Create 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 from
      key - Key to extract
      defaultValue - 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