@Test public void getKeyedValue_providesCorrespondingValues() { ImapList list = buildSampleList(); assertEquals("TWO", list.getKeyedValue("ONE")); assertEquals("THREE", list.getKeyedValue("TWO")); assertNull(list.getKeyedValue("THREE")); assertNull(list.getKeyedValue("nonexistent")); }
public Object getKeyedValue(String key) { for (int i = 0, count = size() - 1; i < count; i++) { if (ImapResponseParser.equalsIgnoreCase(get(i), key)) { return get(i + 1); } } return null; }
ImapList extends ArrayList<Object> { public Object getKeyedValue(String key) { for (int i = 0, count = size() - 1; i < count; i++) { if (ImapResponseParser.equalsIgnoreCase(get(i), key)) { return get(i + 1); } } return null; } }
ImapList extends ArrayList<Object> { public Object getKeyedValue(String key) { for (int i = 0, count = size() - 1; i < count; i++) { if (ImapResponseParser.equalsIgnoreCase(get(i), key)) { return get(i + 1); } } return null; }  }
ImapList extends ArrayList<Object> { public Object getKeyedValue(String key) { for (int i = 0, count = size() - 1; i < count; i++) { if (ImapResponseParser.equalsIgnoreCase(get(i), key)) { return get(i + 1); } } return null; }  ImapList getList(int index); boolean isList(int index); Object getObject(int index); String getString(int index); boolean isString(int index); long getLong(int index); int getNumber(int index); Date getDate(int index); Date getKeyedDate(String key); Object getKeyedValue(String key); ImapList getKeyedList(String key); String getKeyedString(String key); int getKeyedNumber(String key); boolean containsKey(String key); int getKeyIndex(String key); }
ImapList extends ArrayList<Object> { public Object getKeyedValue(String key) { for (int i = 0, count = size() - 1; i < count; i++) { if (ImapResponseParser.equalsIgnoreCase(get(i), key)) { return get(i + 1); } } return null; }  ImapList getList(int index); boolean isList(int index); Object getObject(int index); String getString(int index); boolean isString(int index); long getLong(int index); int getNumber(int index); Date getDate(int index); Date getKeyedDate(String key); Object getKeyedValue(String key); ImapList getKeyedList(String key); String getKeyedString(String key); int getKeyedNumber(String key); boolean containsKey(String key); int getKeyIndex(String key);  }