Class OrderValidityDate
- java.lang.Object
-
- com.caplin.motif.fx.trading.orders.submission.OrderValidityDate
-
- Direct Known Subclasses:
ActivationDate
,ExpirationDate
@Deprecated public class OrderValidityDate extends Object
Deprecated.Parent class ofActivationDate
andExpirationDate
that represents a date for an order.
-
-
Field Summary
Fields Modifier and Type Field Description protected static Pattern
DATE_PATTERN
Deprecated.protected String
dateStr
Deprecated.protected Date
datetime
Deprecated.protected boolean
isLocal
Deprecated.static String
LOCAL
Deprecated.protected String
location
Deprecated.protected String
offset
Deprecated.protected String
timeStr
Deprecated.static String
ZEROED_OFFSET
Deprecated.
-
Constructor Summary
Constructors Constructor Description OrderValidityDate()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object obj)
Deprecated.String
getDateAsString()
Deprecated.Gets the date as a string in the format "YYYYMMDD".Date
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.String
getLocation()
Deprecated.Gets the location that the date and time relate to.String
getOffset()
Deprecated.Gets the UTC offset for the time, in the format "[+-][0-9]{2}:[0-9]{2}", e.g "+01:00".String
getTimeAsString()
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
parse(String dateStr, String timeStr, String location, String offset)
Deprecated.Sets the date, time, location and offset values from the parameters.String
toString()
Deprecated.
-
-
-
Field Detail
-
LOCAL
public static final String LOCAL
Deprecated.- See Also:
- Constant Field Values
-
ZEROED_OFFSET
public static final String ZEROED_OFFSET
Deprecated.- See Also:
- Constant Field Values
-
DATE_PATTERN
protected static final Pattern DATE_PATTERN
Deprecated.
-
dateStr
protected String dateStr
Deprecated.
-
timeStr
protected String timeStr
Deprecated.
-
location
protected String location
Deprecated.
-
offset
protected String offset
Deprecated.
-
datetime
protected Date datetime
Deprecated.
-
isLocal
protected boolean isLocal
Deprecated.
-
-
Method Detail
-
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 public Date 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
public String getDateAsString()
Deprecated.Gets the date as a string in the format "YYYYMMDD".- Returns:
- The date as a string.
-
getTimeAsString
public String getTimeAsString()
Deprecated.Gets the time as a string in the format "HH:MM:SS".- Returns:
- The time as a string.
-
getLocation
public String getLocation()
Deprecated.Gets the location that the date and time relate to.- Returns:
- The location if specified, otherwise null.
-
getOffset
public String 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.
-
-