@Override public TypeBuilder<?> handleClass(Class<?> clazz, List<Type> genericTypes, TypeHandlerManager typeHandlerManager, ParsingContext context, BaseTypeBuilder<?> typeBuilder) { final DictionaryTypeBuilder<? extends BaseTypeBuilder<?>> dictionaryType = typeBuilder.dictionaryType().id(clazz.getName()); if (genericTypes.isEmpty()) { dictionaryType.ofKey().anyType(); dictionaryType.ofValue().anyType(); } else if (genericTypes.size() != 2) { throw new IllegalArgumentException(String.format("Exactly 2 generics were expected but %d were provided instead", genericTypes.size())); } else { parseGenericType(genericTypes.get(0), dictionaryType::ofKey, dictionaryType::ofKey, context, typeHandlerManager); parseGenericType(genericTypes.get(1), dictionaryType::ofValue, dictionaryType::ofValue, context, typeHandlerManager); } return dictionaryType; }