Class CsvLoaderUtils

    • Field Detail

      • SECURITY_ID_SCHEME_FIELD

        public static final java.lang.String SECURITY_ID_SCHEME_FIELD
        The column name for the security ID scheme/symbology.
        See Also:
        Constant Field Values
      • SECURITY_ID_FIELD

        public static final java.lang.String SECURITY_ID_FIELD
        The column name for the security ID.
        See Also:
        Constant Field Values
      • EXCHANGE_FIELD

        public static final java.lang.String EXCHANGE_FIELD
        The column name for the exchange.
        See Also:
        Constant Field Values
      • CONTRACT_CODE_FIELD

        public static final java.lang.String CONTRACT_CODE_FIELD
        The column name for the contract code.
        See Also:
        Constant Field Values
      • LONG_QUANTITY_FIELD

        public static final java.lang.String LONG_QUANTITY_FIELD
        The column name for the long quantity.
        See Also:
        Constant Field Values
      • SHORT_QUANTITY_FIELD

        public static final java.lang.String SHORT_QUANTITY_FIELD
        The column name for the short quantity.
        See Also:
        Constant Field Values
      • QUANTITY_FIELD

        public static final java.lang.String QUANTITY_FIELD
        The column name for the quantity.
        See Also:
        Constant Field Values
      • PRICE_FIELD

        public static final java.lang.String PRICE_FIELD
        The column name for the price.
        See Also:
        Constant Field Values
      • EXPIRY_FIELD

        public static final java.lang.String EXPIRY_FIELD
        The column name for the expiry month/year.
        See Also:
        Constant Field Values
      • EXPIRY_WEEK_FIELD

        public static final java.lang.String EXPIRY_WEEK_FIELD
        The column name for the expiry week.
        See Also:
        Constant Field Values
      • EXPIRY_DAY_FIELD

        public static final java.lang.String EXPIRY_DAY_FIELD
        The column name for the expiry day.
        See Also:
        Constant Field Values
      • SETTLEMENT_TYPE_FIELD

        public static final java.lang.String SETTLEMENT_TYPE_FIELD
        The column name for the settlement type.
        See Also:
        Constant Field Values
      • EXERCISE_STYLE_FIELD

        public static final java.lang.String EXERCISE_STYLE_FIELD
        The column name for the exercise style.
        See Also:
        Constant Field Values
      • VERSION_FIELD

        public static final java.lang.String VERSION_FIELD
        The column name for the option version.
        See Also:
        Constant Field Values
      • PUT_CALL_FIELD

        public static final java.lang.String PUT_CALL_FIELD
        The column name for the put/call flag.
        See Also:
        Constant Field Values
      • EXERCISE_PRICE_FIELD

        public static final java.lang.String EXERCISE_PRICE_FIELD
        The column name for the option strike price.
        See Also:
        Constant Field Values
      • UNDERLYING_EXPIRY_FIELD

        public static final java.lang.String UNDERLYING_EXPIRY_FIELD
        The column name for the underlying expiry month/year.
        See Also:
        Constant Field Values
      • CURRENCY

        public static final java.lang.String CURRENCY
        The column name for the currency.
        See Also:
        Constant Field Values
      • TICK_SIZE

        public static final java.lang.String TICK_SIZE
        The column name for the tick size.
        See Also:
        Constant Field Values
      • TICK_VALUE

        public static final java.lang.String TICK_VALUE
        The column name for the tick value.
        See Also:
        Constant Field Values
      • CONTRACT_SIZE

        public static final java.lang.String CONTRACT_SIZE
        The column name for the contract size.
        See Also:
        Constant Field Values
      • DEFAULT_OPTION_VERSION_NUMBER

        public static final int DEFAULT_OPTION_VERSION_NUMBER
        Default version used as an option might not specify a version number.
        See Also:
        Constant Field Values
      • SETTLEMENT_BY_CODE

        public static final com.google.common.collect.ImmutableMap<java.lang.String,​EtdSettlementType> SETTLEMENT_BY_CODE
        Lookup settlement by code.
    • Method Detail

      • parseEtdVariant

        public static Pair<java.time.YearMonth,​EtdVariant> parseEtdVariant​(CsvRow row,
                                                                                 EtdType type)
        Parses the year-month and variant.
        Parameters:
        row - the CSV row to parse
        type - the ETD type
        Returns:
        the expiry year-month and variant
        Throws:
        java.lang.IllegalArgumentException - if the row cannot be parsed
      • parseEtdSettlementType

        public static EtdSettlementType parseEtdSettlementType​(java.lang.String str)
        Parses the ETD settlement type from the short code or full name.
        Parameters:
        str - the string to parse
        Returns:
        the settlement type
        Throws:
        java.lang.IllegalArgumentException - if the string cannot be parsed
      • parseEtdOptionType

        public static EtdOptionType parseEtdOptionType​(java.lang.String str)
        Parses the ETD option type from the short code or full name.
        Parameters:
        str - the string to parse
        Returns:
        the option type
        Throws:
        java.lang.IllegalArgumentException - if the string cannot be parsed
      • parseQuantity

        public static DoublesPair parseQuantity​(CsvRow row)
        Parses the quantity.
        Parameters:
        row - the CSV row to parse
        Returns:
        the quantity, long first, short second
        Throws:
        java.lang.IllegalArgumentException - if the row cannot be parsed