Package com.timeanddate.services
Class TimeService
java.lang.Object
com.timeanddate.services.BaseService
com.timeanddate.services.TimeService
- Author:
- Cato Auestad <cato@timeanddate.com>
-
Field Summary
Fields inherited from class com.timeanddate.services.BaseService
Language, ServiceName, Version
-
Constructor Summary
ConstructorsConstructorDescriptionTimeService(String accessKey, String secretKey)
The timeservice service can be used to retrieve the current time in one or more places. -
Method Summary
Modifier and TypeMethodDescriptioncurrentTimeForPlace(LocationId placeId)
Retrieves the current time for place by ID.boolean
boolean
boolean
boolean
int
void
setIncludeCoordinates(boolean bool)
void
setIncludeCurrentTimeToLocation(boolean bool)
void
setIncludeListOfTimeChanges(boolean bool)
void
setIncludeSunriseAndSunset(boolean bool)
void
setRadius(int radius)
-
Constructor Details
-
TimeService
The timeservice service can be used to retrieve the current time in one or more places. Additionally, information about time zones and related changes and the time of sunrise and sunset can be queried.- Parameters:
accessKey
- Access key.secretKey
- Secret key.- Throws:
AuthenticationException
- Encryption of the authentication failed
-
-
Method Details
-
currentTimeForPlace
public List<Location> currentTimeForPlace(LocationId placeId) throws IllegalArgumentException, ServerSideExceptionRetrieves the current time for place by ID.- Parameters:
placeId
- Place identifier.- Returns:
- The current time for place.
- Throws:
ServerSideException
- The server produced an error messageIllegalArgumentException
- A required argument was not as expected
-
setIncludeCoordinates
public void setIncludeCoordinates(boolean bool) -
getIncludeCoordinates
public boolean getIncludeCoordinates() -
setRadius
public void setRadius(int radius) -
getRadius
public int getRadius() -
setIncludeSunriseAndSunset
public void setIncludeSunriseAndSunset(boolean bool) -
getIncludeSunriseAndSunset
public boolean getIncludeSunriseAndSunset() -
setIncludeCurrentTimeToLocation
public void setIncludeCurrentTimeToLocation(boolean bool) -
getIncludeCurrentTimeToLocation
public boolean getIncludeCurrentTimeToLocation() -
setIncludeListOfTimeChanges
public void setIncludeListOfTimeChanges(boolean bool) -
getIncludeListOfTimeChanges
public boolean getIncludeListOfTimeChanges()
-