ComparatorType { public static ComparatorType getByClassName(String className) { if (className == null) { return null; } ComparatorType type = valuesMap.get(className); if (type == null) { return new ComparatorType(className); } return type; } private  ComparatorType(String className); String getClassName(); String getTypeName(); static ComparatorType getByClassName(String className); @Override int hashCode(); @Override boolean equals(Object obj); static final ComparatorType ASCIITYPE; static final ComparatorType BOOLEANTYPE; static final ComparatorType BYTESTYPE; static final ComparatorType COLLECTIONTYPE; static final ComparatorType DATETYPE; static final ComparatorType DECIMALTYPE; static final ComparatorType DOUBLETYPE; static final ComparatorType FLOATTYPE; static final ComparatorType INTEGERTYPE; static final ComparatorType INT32TYPE; static final ComparatorType LEXICALUUIDTYPE; static final ComparatorType LISTTYPE; static final ComparatorType LOCALBYPARTITIONERTYPE; static final ComparatorType LONGTYPE; static final ComparatorType MAPTYPE; static final ComparatorType SETTYPE; static final ComparatorType TIMEUUIDTYPE; static final ComparatorType UTF8TYPE; static final ComparatorType COMPOSITETYPE; static final ComparatorType DYNAMICCOMPOSITETYPE; static final ComparatorType UUIDTYPE; static final ComparatorType COUNTERTYPE; static final ComparatorType REVERSEDTYPE; }
@Test public void getByClassNameShouldReturnNullWhenNullClassName() { assertEquals(null, ComparatorType.getByClassName(null)); }
@Test public void getByClassNameShouldReturnCorrectKnownComaparators() { assertEquals(ASCIITYPE, ComparatorType.getByClassName("org.apache.cassandra.db.marshal.AsciiType")); assertEquals(ASCIITYPE, ComparatorType.getByClassName("AsciiType")); assertEquals(BYTESTYPE, ComparatorType.getByClassName("org.apache.cassandra.db.marshal.BytesType")); assertEquals(BYTESTYPE, ComparatorType.getByClassName("BytesType")); assertEquals(INTEGERTYPE, ComparatorType.getByClassName("org.apache.cassandra.db.marshal.IntegerType")); assertEquals(INTEGERTYPE, ComparatorType.getByClassName("IntegerType")); assertEquals(LEXICALUUIDTYPE, ComparatorType.getByClassName("org.apache.cassandra.db.marshal.LexicalUUIDType")); assertEquals(LEXICALUUIDTYPE, ComparatorType.getByClassName("LexicalUUIDType")); assertEquals(LOCALBYPARTITIONERTYPE, ComparatorType.getByClassName("org.apache.cassandra.db.marshal.LocalByPartionerType")); assertEquals(LOCALBYPARTITIONERTYPE, ComparatorType.getByClassName("LocalByPartionerType")); assertEquals(LONGTYPE, ComparatorType.getByClassName("org.apache.cassandra.db.marshal.LongType")); assertEquals(LONGTYPE, ComparatorType.getByClassName("LongType")); assertEquals(TIMEUUIDTYPE, ComparatorType.getByClassName("org.apache.cassandra.db.marshal.TimeUUIDType")); assertEquals(TIMEUUIDTYPE, ComparatorType.getByClassName("TimeUUIDType")); assertEquals(UTF8TYPE, ComparatorType.getByClassName("org.apache.cassandra.db.marshal.UTF8Type")); assertEquals(UTF8TYPE, ComparatorType.getByClassName("UTF8Type")); assertEquals(COMPOSITETYPE, ComparatorType.getByClassName("org.apache.cassandra.db.marshal.CompositeType")); assertEquals(COMPOSITETYPE, ComparatorType.getByClassName("CompositeType")); assertEquals(DYNAMICCOMPOSITETYPE, ComparatorType.getByClassName("org.apache.cassandra.db.marshal.DynamicCompositeType")); assertEquals(DYNAMICCOMPOSITETYPE, ComparatorType.getByClassName("DynamicCompositeType")); assertEquals(UUIDTYPE, ComparatorType.getByClassName("org.apache.cassandra.db.marshal.UUIDType")); assertEquals(UUIDTYPE, ComparatorType.getByClassName("UUIDType")); assertEquals(COUNTERTYPE, ComparatorType.getByClassName("org.apache.cassandra.db.marshal.CounterColumnType")); assertEquals(COUNTERTYPE, ComparatorType.getByClassName("CounterColumnType")); }