@Test public void addIndexRange() { doReturn(null).when(indexes).put(anyString(), any(CacheIndex.class)); handler.addIndex("a", IndexType.RANGE_INDEX); verify(indexes).put(anyString(), any(RangeIndex.class)); }
public void addIndex(final String attributeName, final IndexType type) { if (type == IndexType.UNIQUE_HASH) { indexes.put(attributeName, new UniqueHashIndex()); } else if (type == IndexType.NON_UNIQUE_HASH) { indexes.put(attributeName, new NonUniqueHashIndex()); } else if (type == IndexType.RANGE_INDEX) { indexes.put(attributeName, new RangeIndex()); } }
DefaultIndexHandler implements IndexHandler<K, V> { public void addIndex(final String attributeName, final IndexType type) { if (type == IndexType.UNIQUE_HASH) { indexes.put(attributeName, new UniqueHashIndex()); } else if (type == IndexType.NON_UNIQUE_HASH) { indexes.put(attributeName, new NonUniqueHashIndex()); } else if (type == IndexType.RANGE_INDEX) { indexes.put(attributeName, new RangeIndex()); } } }
DefaultIndexHandler implements IndexHandler<K, V> { public void addIndex(final String attributeName, final IndexType type) { if (type == IndexType.UNIQUE_HASH) { indexes.put(attributeName, new UniqueHashIndex()); } else if (type == IndexType.NON_UNIQUE_HASH) { indexes.put(attributeName, new NonUniqueHashIndex()); } else if (type == IndexType.RANGE_INDEX) { indexes.put(attributeName, new RangeIndex()); } } DefaultIndexHandler(); }
DefaultIndexHandler implements IndexHandler<K, V> { public void addIndex(final String attributeName, final IndexType type) { if (type == IndexType.UNIQUE_HASH) { indexes.put(attributeName, new UniqueHashIndex()); } else if (type == IndexType.NON_UNIQUE_HASH) { indexes.put(attributeName, new NonUniqueHashIndex()); } else if (type == IndexType.RANGE_INDEX) { indexes.put(attributeName, new RangeIndex()); } } DefaultIndexHandler(); void addIndex(final String attributeName, final IndexType type); void add(final K key, final V value); void remove(final K key, final V value); void clear(); @SuppressWarnings("unchecked") List<K> execute(final Query query); }
DefaultIndexHandler implements IndexHandler<K, V> { public void addIndex(final String attributeName, final IndexType type) { if (type == IndexType.UNIQUE_HASH) { indexes.put(attributeName, new UniqueHashIndex()); } else if (type == IndexType.NON_UNIQUE_HASH) { indexes.put(attributeName, new NonUniqueHashIndex()); } else if (type == IndexType.RANGE_INDEX) { indexes.put(attributeName, new RangeIndex()); } } DefaultIndexHandler(); void addIndex(final String attributeName, final IndexType type); void add(final K key, final V value); void remove(final K key, final V value); void clear(); @SuppressWarnings("unchecked") List<K> execute(final Query query);  }