IbUtils { public static QuoteType getQuoteType(int field) { switch (field) { case 0: return QuoteType.BID_SIZE; case 1: return QuoteType.BID; case 2: return QuoteType.ASK; case 3: return QuoteType.ASK_SIZE; case 4: return QuoteType.LAST; case 5: return QuoteType.LAST_SIZE; case 8: return QuoteType.VOLUME; case 9: return QuoteType.CLOSE; case 14: return QuoteType.OPEN; default: return QuoteType.UNKNOWN; } }  static String translateToIbFuturesSymbol(String symbol); static String getOrderType(TradeOrder.Type orderType); static String getTif(TradeOrder.Duration duration); static String getSecurityType(InstrumentType instrumentType); static String getAction(TradeDirection direction); static QuoteType getQuoteType(int field); static OrderStatus.Status getOrderStatus(String status); static String getExpiryString(int expiryMonth, int expiryYear); static String getExpiryString(int expiryDay, int expiryMonth, int expiryYear); static String getOptionRight( OptionTicker.Right right ); static Image getIconImage(); static BigDecimal getIbMultiplier( Ticker ticker ); static Vector<TagValue> getDefaultTagVector(); static List<TagValue> getDefaultTagList();  }
@Test public void testGetQuoteType() { assertEquals(QuoteType.BID, IbUtils.getQuoteType(1)); assertEquals(QuoteType.ASK, IbUtils.getQuoteType(2)); assertEquals(QuoteType.LAST, IbUtils.getQuoteType(4)); assertEquals(QuoteType.CLOSE, IbUtils.getQuoteType(9)); assertEquals(QuoteType.OPEN, IbUtils.getQuoteType(14)); assertEquals(QuoteType.VOLUME, IbUtils.getQuoteType(8)); assertEquals(QuoteType.UNKNOWN, IbUtils.getQuoteType(99)); }