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 of ActivationDate and ExpirationDate that represents a date for an order.
  • Field Details

    • LOCAL

      public static final String LOCAL
      Deprecated.
      See Also:
    • ZEROED_OFFSET

      public static final String ZEROED_OFFSET
      Deprecated.
      See Also:
    • 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.
  • 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 public Date getDateTime()
      Deprecated.
      The Date object returned by this method is created by parsing the date and time passed in to the parse(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 methods getDateAsString(), getTimeAsString(), getLocation() and getOffset() instead.
      Gets the date and time as an instance of Date.
      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 calling getOffset(), 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.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Deprecated.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object