public class BreinTemporalData extends BreinBase<BreinTemporalData> implements IExecutable<BreinTemporalDataResult>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CITY_TEXT_FIELD |
static java.lang.String |
COUNTRY_TEXT_FIELD |
static java.lang.String |
IP_ADDRESS_FIELD |
static java.time.format.DateTimeFormatter |
JAVA_SCRIPT_FORMAT |
static java.lang.String |
LATITUDE_FIELD |
static java.lang.String |
LOCAL_DATE_TIME_FIELD |
static java.lang.String |
LOCATION_FIELD
The following fields are used within the additional
|
static java.lang.String |
LONGITUDE_FIELD
The following fields are used within the location
|
static java.lang.String |
SHAPE_TYPES_FIELD |
static java.lang.String |
STATE_TEXT_FIELD |
static java.lang.String |
TEXT_FIELD |
static java.lang.String |
TIMEZONE_FIELD |
API_KEY_FIELD, GSON, IP_ADDRESS, SIGNATURE_FIELD, SIGNATURE_TYPE_FIELD, UNIX_TIMESTAMP_FIELD| Constructor and Description |
|---|
BreinTemporalData() |
| Modifier and Type | Method and Description |
|---|---|
BreinTemporalData |
addShapeTypes(java.lang.String... shapeTypes)
Adds the specified
shapeTypes to the currently defined shape-types to be returned with the response of
the request, i.e.: |
java.lang.String |
createSignature(BreinConfig config,
java.util.Map<java.lang.String,java.lang.Object> requestData)
Creates the signature for temporaldata
|
BreinTemporalDataResult |
execute()
Method to execute the request synchronous.
|
java.lang.String |
getEndPoint(BreinConfig config)
Gets the endpoint to be used to send the request to
|
<T> T |
getLocation(java.lang.String key)
Gets the current value specified within the location of the request.
|
void |
prepareRequestData(BreinConfig config,
java.util.Map<java.lang.String,java.lang.Object> requestData)
This method adds the request specific information to the
requestData. |
BreinTemporalData |
setLatitude(double latitude)
Sets the latitude used to look-up the temporal information, i.e.:
|
BreinTemporalData |
setLocalDateTime()
Sets the localDateTime based on the system's time, i.e.:
|
BreinTemporalData |
setLocalDateTime(java.lang.String timeString)
Sets the localDateTime for a Stringified date, which will be parsed server side, i.e.:
|
BreinTemporalData |
setLocalDateTime(java.time.ZonedDateTime zonedDateTime)
Sets the localDateTime, i.e.:
|
BreinTemporalData |
setLocation(java.lang.String freeText)
Sets the location data using free text, i.e.:
|
BreinTemporalData |
setLocation(java.lang.String key,
java.lang.Object value) |
BreinTemporalData |
setLocation(java.lang.String city,
java.lang.String state,
java.lang.String country)
Sets the location data using structured data (city, state, country), i.e.:
|
BreinTemporalData |
setLongitude(double longitude)
Sets the longitude used to look-up the temporal information, i.e.:
|
BreinTemporalData |
setLookUpIpAddress(java.lang.String ipAddress)
Sets the ipAddress used to look-up the temporal information, i.e.:
|
BreinTemporalData |
setShapeTypes(java.lang.String... shapeTypes)
Sets the shape-types to be returned with the response of the request, i.e.:
|
BreinTemporalData |
setTimezone(java.lang.String timezone)
Sets the timezone within the request, i.e.:
|
BreinTemporalData |
setTimezone(java.util.TimeZone timezone)
Sets the timezone within the request, i.e.:
|
getClientIpAddress, getGson, getHeaders, getThis, getUnixTimestamp, getUser, prepareRequestData, set, setAdditional, setClientIpAddress, setHeader, setHeaders, setUnixTimestamp, setUser, setUser, setUser, toStringpublic static final java.time.format.DateTimeFormatter JAVA_SCRIPT_FORMAT
public static final java.lang.String LOCATION_FIELD
public static final java.lang.String LOCAL_DATE_TIME_FIELD
public static final java.lang.String TIMEZONE_FIELD
public static final java.lang.String IP_ADDRESS_FIELD
public static final java.lang.String LONGITUDE_FIELD
public static final java.lang.String LATITUDE_FIELD
public static final java.lang.String SHAPE_TYPES_FIELD
public static final java.lang.String TEXT_FIELD
public static final java.lang.String CITY_TEXT_FIELD
public static final java.lang.String STATE_TEXT_FIELD
public static final java.lang.String COUNTRY_TEXT_FIELD
public java.lang.String getEndPoint(BreinConfig config)
BreinBasegetEndPoint in class BreinBase<BreinTemporalData>config - the current configurationBreinConfigpublic void prepareRequestData(BreinConfig config, java.util.Map<java.lang.String,java.lang.Object> requestData)
BreinBaserequestData. It is called by BreinBase.prepareRequestData(BreinConfig) after the request data of the base information is added.prepareRequestData in class BreinBase<BreinTemporalData>requestData - the request data to be sent to the endpointpublic BreinTemporalData setTimezone(java.util.TimeZone timezone)
{
user: {
additional: {
'timezone': timezone
}
}
}
timezone - the value to be setthispublic BreinTemporalData setTimezone(java.lang.String timezone)
{
user: {
additional: {
'timezone': timezone
}
}
}
timezone - the value to be setthispublic BreinTemporalData setLookUpIpAddress(java.lang.String ipAddress)
{
user: {
additional: {
'ipAddress': ipAddress
}
}
}
ipAddress - the value to be setthispublic BreinTemporalData setLongitude(double longitude)
{
user: {
additional: {
location: {
'longitude': longitude
}
}
}
}
longitude - the longitude to be usedthispublic BreinTemporalData setLatitude(double latitude)
{
user: {
additional: {
location: {
'latitude': latitude
}
}
}
}
latitude - the latitude to be usedthispublic BreinTemporalData setShapeTypes(java.lang.String... shapeTypes)
{
user: {
additional: {
location: {
'shapeTypes': [...]
}
}
}
}
shapeTypes - the shapeTypes to be set, if empty the shapeTypes will be removedthispublic BreinTemporalData setLocation(java.lang.String freeText)
{
user: {
additional: {
location: {
'text': freeText
}
}
}
}
freeText - the text describing the locationthispublic BreinTemporalData setLocalDateTime()
{
user: {
additional: {
'localDateTime': now
}
}
}
thisZonedDateTime.now()public BreinTemporalData setLocalDateTime(java.time.ZonedDateTime zonedDateTime)
{
user: {
additional: {
'localDateTime': zonedDateTime
}
}
}
thispublic BreinTemporalData setLocalDateTime(java.lang.String timeString)
{
user: {
additional: {
'localDateTime': zonedDateTime
}
}
}
thispublic BreinTemporalData setLocation(java.lang.String city, java.lang.String state, java.lang.String country)
{
user: {
additional: {
location: {
'city': city,
'state': state,
'country': country
}
}
}
}
city - the city to look upstate - the state to look up (can be null)country - the country to look up (can be null)thispublic BreinTemporalData addShapeTypes(java.lang.String... shapeTypes)
shapeTypes to the currently defined shape-types to be returned with the response of
the request, i.e.:
{
user: {
additional: {
location: {
'shapeTypes': [...]
}
}
}
}
shapeTypes - the shapeTypes to be addedthispublic <T> T getLocation(java.lang.String key)
T - the expected type of the returned valuekey - the value to retrieve (e.g., "shapeTypes", "city", or "latitude")public BreinTemporalData setLocation(java.lang.String key, java.lang.Object value)
public java.lang.String createSignature(BreinConfig config, java.util.Map<java.lang.String,java.lang.Object> requestData)
createSignature in interface ISecretStrategyconfig - the configurationrequestData - the data used for the request including all the data that will be sent, without the signaturepublic BreinTemporalDataResult execute()
IExecutableexecute in interface IExecutable<BreinTemporalDataResult>Copyright © Breinify - All Rights Reserved.