Class OrderValidityDate
java.lang.Object
com.caplin.motif.fx.trading.orders.submission.OrderValidityDate
- Direct Known Subclasses:
ActivationDate
,ExpirationDate
Deprecated.
Parent class of
ActivationDate
and ExpirationDate
that represents a date for an order.-
Field Summary
Modifier and TypeFieldDescriptionprotected static final Pattern
Deprecated.protected String
Deprecated.protected Date
Deprecated.protected boolean
Deprecated.static final String
Deprecated.protected String
Deprecated.protected String
Deprecated.protected String
Deprecated.static final String
Deprecated. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.Deprecated.Gets the date as a string in the format "YYYYMMDD".Deprecated.Deprecated.Gets the location that the date and time relate to.Deprecated.Gets the UTC offset for the time, in the format "[+-][0-9]{2}:[0-9]{2}", e.g "+01:00".Deprecated.Gets the time as a string in the format "HH:MM:SS".int
hashCode()
Deprecated.boolean
isLocal()
Deprecated.Returns a boolean indicating whether this date and time were specified as local to the user, in which case a UTC offset should also be present and can be retrieved by callinggetOffset()
, or if the date and time relate to a specific location in which case no offset needs to be provided.protected void
Deprecated.Sets the date, time, location and offset values from the parameters.toString()
Deprecated.
-
Field Details
-
LOCAL
Deprecated.- See Also:
-
ZEROED_OFFSET
Deprecated.- See Also:
-
DATE_PATTERN
Deprecated. -
dateStr
Deprecated. -
timeStr
Deprecated. -
location
Deprecated. -
offset
Deprecated. -
datetime
Deprecated. -
isLocal
protected boolean isLocalDeprecated.
-
-
Constructor Details
-
OrderValidityDate
public OrderValidityDate()Deprecated.
-
-
Method Details
-
parse
protected void parse(String dateStr, String timeStr, String location, String offset) throws OrderConfigurationException Deprecated.Sets the date, time, location and offset values from the parameters.- Parameters:
dateStr
- A date in the format "YYYYMMDD".timeStr
- A time in the format "HH:MM:SS".location
- A location, which can be a place such as "London" or the string "LOCAL". If a location is provided, it is not necessary (or permitted) to provide an offset because it can be inferred from the date, time and location.offset
- A timezone offset in the format "[+-][0-9]{2}:[0-9]{2}", e.g "+01:00".- Throws:
OrderConfigurationException
-If:
- Any of dateStr, timeStr or location are null or empty.
- The location has the value LOCAL but the offset is null or empty.
- The location has the value LOCAL and the offset is specified in the wrong format.
- The location was provided (i.e not LOCAL) but an offset was also provided.
- The value of dateStr or timeStr are in the wrong format.
-
getDateTime
Deprecated.The Date object returned by this method is created by parsing the date and time passed in to theparse(String, String, String, String)
method, without taking the offset or location parameters into account. Because of this limitation, the Date object returned by this method is not a true representation of this instance of OrderValidityDate, and this method has been deprecated accordingly. Client code should use the methodsgetDateAsString()
,getTimeAsString()
,getLocation()
andgetOffset()
instead.Gets the date and time as an instance ofDate
.- Returns:
- A Date object representing the date and time of this instance of OrderValidityDate, without taking the location or offset into account.
-
getDateAsString
Deprecated.Gets the date as a string in the format "YYYYMMDD".- Returns:
- The date as a string.
-
getTimeAsString
Deprecated.Gets the time as a string in the format "HH:MM:SS".- Returns:
- The time as a string.
-
getLocation
Deprecated.Gets the location that the date and time relate to.- Returns:
- The location if specified, otherwise null.
-
getOffset
Deprecated.Gets the UTC offset for the time, in the format "[+-][0-9]{2}:[0-9]{2}", e.g "+01:00".- Returns:
- The timezone offset if specified, otherwise "00:00". The offset is only specified if this instance of OrderValidityDate was constructed with the location LOCAL.
-
isLocal
public boolean isLocal()Deprecated.Returns a boolean indicating whether this date and time were specified as local to the user, in which case a UTC offset should also be present and can be retrieved by callinggetOffset()
, or if the date and time relate to a specific location in which case no offset needs to be provided.- Returns:
- True if this date relates to the user's local time, false if it relates to a specific location.
-
hashCode
public int hashCode()Deprecated. -
equals
Deprecated. -
toString
Deprecated.
-
parse(String, String, String, String)
method, without taking the offset or location parameters into account.