Class DataHelper

java.lang.Object
io.bayonet.helpers.DataHelper

public class DataHelper
extends java.lang.Object
Created by imranarshad on 11/27/17 Helper class to assist with all data operations, eg. parsing JSON, data validations, etc.
  • Constructor Summary

    Constructors 
    Constructor Description
    DataHelper()  
  • Method Summary

    Modifier and Type Method Description
    static void validateApiKey​(java.lang.String api_key)
    Helper function to validate the provided api key - Api key should be non-null and non-empty
    static void validateApiVersion​(java.lang.String api_version, java.util.HashSet<java.lang.String> supported_versions)
    Helper function to validate the provided Api version - Api version should be non-null and non-empty - Api version should be one of the versions supported by this SDK

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • validateApiKey

      public static void validateApiKey​(java.lang.String api_key) throws BayonetException
      Helper function to validate the provided api key - Api key should be non-null and non-empty
      Parameters:
      api_key - to validate
      Throws:
      BayonetException - if the Api key is invalid
    • validateApiVersion

      public static void validateApiVersion​(java.lang.String api_version, java.util.HashSet<java.lang.String> supported_versions) throws BayonetException
      Helper function to validate the provided Api version - Api version should be non-null and non-empty - Api version should be one of the versions supported by this SDK
      Parameters:
      api_version - to validate
      supported_versions - versions supported by this SDK
      Throws:
      BayonetException - if the Api version is invalid