DimensionDictionary implements Serializable { public Integer getValueId(String dimensionName, String dimensionValue) { Integer valueId = getDictionary(dimensionName).get(dimensionValue); if (valueId == null) { valueId = StarTreeConstants.OTHER_VALUE; } return valueId; } DimensionDictionary();  DimensionDictionary(Map<String, Map<String, Integer>> dictionary); void setDictionary(Map<String, Map<String, Integer>> dictionary); Map<String, Map<String, Integer>> getDictionary(); Map<String, Map<Integer, String>> getReverseDictionary(); Map<String, Integer> getDictionary(String dimensionName); Map<Integer, String> getReverseDictionary(String dimensionName); Integer getValueId(String dimensionName, String dimensionValue); String getDimensionValue(String dimensionName, Integer valueId); int[] translate(List<DimensionSpec> dimensions, DimensionKey dimensionKey); DimensionKey translate(List<DimensionSpec> dimensions, int[] dimensionKey); @Override boolean equals(Object o);  }
@Test public void testGetValueId() { Assert.assertEquals(dictionary.getValueId("A", "A0"), Integer.valueOf(2)); }
@Test public void testGetValueIdNoMapping() { Assert.assertEquals(dictionary.getValueId("A", "A4").intValue(), StarTreeConstants.OTHER_VALUE); }