Class DialCodeService

java.lang.Object
com.timeanddate.services.BaseService
com.timeanddate.services.DialCodeService

public class DialCodeService extends BaseService
Author:
Cato Auestad <cato@timeanddate.com>
  • Constructor Details

    • DialCodeService

      public DialCodeService(String accessKey, String secretKey) throws AuthenticationException
      The dialcode service can be used determine which phone number shall be used to call a specific location.
      Parameters:
      accessKey - Access key.
      secretKey - Secret key.
      Throws:
      AuthenticationException - Encryption of the authentication failed
  • Method Details

    • getDialCode

      public DialCodes getDialCode(LocationId toLocation) throws IllegalArgumentException, ServerSideException
      Gets the dial code for the location you want to call
      Parameters:
      toLocation - To location.
      Returns:
      The dial code.
      Throws:
      ServerSideException - The server produced an error message
      IllegalArgumentException - A required argument was not as expected
    • getDialCode

      public DialCodes getDialCode(LocationId toLocation, LocationId fromLocation) throws IllegalArgumentException, ServerSideException
      Gets the dial code for the location you want to call, from where
      Parameters:
      toLocation - To location.
      fromLocation - From location.
      Returns:
      The dial code.
      Throws:
      ServerSideException - The server produced an error message
      IllegalArgumentException - A required argument was not as expected
    • getDialCode

      public DialCodes getDialCode(LocationId toLocation, LocationId fromLocation, int number) throws IllegalArgumentException, ServerSideException
      Gets the dial code for the location you want to call, from where with number
      Parameters:
      toLocation - To location.
      fromLocation - From location.
      number - Number.
      Returns:
      The dial code.
      Throws:
      ServerSideException - The server produced an error message
      IllegalArgumentException - A required argument was not as expected
    • setIncludeCurrentTime

      public void setIncludeCurrentTime(boolean bool)
    • getIncludeCurrentTime

      public boolean getIncludeCurrentTime()
    • setIncludeLocations

      public void setIncludeLocations(boolean bool)
    • getIncludeLocations

      public boolean getIncludeLocations()
    • setIncludeCoordinates

      public void setIncludeCoordinates(boolean bool)
    • getIncludeCoordinates

      public boolean getIncludeCoordinates()
    • setIncludeTimezoneInformation

      public void setIncludeTimezoneInformation(boolean bool)
    • getIncludeTimezoneInformation

      public boolean getIncludeTimezoneInformation()