@Test public void testCreateMapTypeOfClass() { ASTMCMapType type = mcTypeFacade.createMapTypeOf(String.class, Integer.class); assertEquals(1, type.sizeNames()); assertEquals("Map", type.getName(0)); assertEquals(2, type.sizeMCTypeArguments()); assertTrue(type.getKey().getMCTypeOpt().isPresent()); assertTrue(type.getKey().getMCTypeOpt().get() instanceof ASTMCQualifiedType); assertEquals(Lists.newArrayList("String"), ((ASTMCQualifiedType) type.getKey().getMCTypeOpt().get()).getNameList()); assertTrue(type.getValue().getMCTypeOpt().isPresent()); assertTrue(type.getValue().getMCTypeOpt().get() instanceof ASTMCQualifiedType); assertEquals(Lists.newArrayList("Integer"), ((ASTMCQualifiedType) type.getValue().getMCTypeOpt().get()).getNameList()); }
public ASTMCMapType createMapTypeOf(final String firstType, final String secondType) { return MCFullGenericTypesMill.mCMapTypeBuilder() .setKey(createBasicTypeArgumentOf(firstType)) .setValue(createBasicTypeArgumentOf(secondType)) .build(); }
MCTypeFacade { public ASTMCMapType createMapTypeOf(final String firstType, final String secondType) { return MCFullGenericTypesMill.mCMapTypeBuilder() .setKey(createBasicTypeArgumentOf(firstType)) .setValue(createBasicTypeArgumentOf(secondType)) .build(); } }
MCTypeFacade { public ASTMCMapType createMapTypeOf(final String firstType, final String secondType) { return MCFullGenericTypesMill.mCMapTypeBuilder() .setKey(createBasicTypeArgumentOf(firstType)) .setValue(createBasicTypeArgumentOf(secondType)) .build(); } private  MCTypeFacade(); }
MCTypeFacade { public ASTMCMapType createMapTypeOf(final String firstType, final String secondType) { return MCFullGenericTypesMill.mCMapTypeBuilder() .setKey(createBasicTypeArgumentOf(firstType)) .setValue(createBasicTypeArgumentOf(secondType)) .build(); } private  MCTypeFacade(); static MCTypeFacade getInstance(); ASTMCQualifiedType createQualifiedType(final Class<?> clazz); ASTMCQualifiedType createQualifiedType(final String name); ASTMCBasicTypeArgument createBasicTypeArgumentOf(String name); ASTMCWildcardTypeArgument createWildCardWithNoBounds(); ASTMCWildcardTypeArgument createWildCardWithUpperBoundType(final Class<?> upperBound); ASTMCWildcardTypeArgument createWildCardWithUpperBoundType(final String upperBound); ASTMCWildcardTypeArgument createWildCardWithUpperBoundType(final ASTMCType upperBound); ASTMCOptionalType createOptionalTypeOf(final String name); ASTMCOptionalType createOptionalTypeOf(final Class<?> clazz); ASTMCOptionalType createOptionalTypeOf(final ASTMCType type); ASTMCOptionalType createOptionalTypeOf(final ASTMCTypeArgument type); ASTMCListType createListTypeOf(final String name); ASTMCListType createListTypeOf(final Class<?> clazz); ASTMCListType createListTypeOf(final ASTMCType type); ASTMCListType createListTypeOf(final ASTMCTypeArgument type); ASTMCSetType createSetTypeOf(final String name); ASTMCSetType createSetTypeOf(final Class<?> clazz); ASTMCSetType createSetTypeOf(final ASTMCType type); ASTMCSetType createSetTypeOf(final ASTMCTypeArgument type); ASTMCGenericType createCollectionTypeOf(final String name); ASTMCGenericType createCollectionTypeOf(final Class<?> clazz); ASTMCGenericType createCollectionTypeOf(final ASTMCType type); ASTMCMapType createMapTypeOf(final String firstType, final String secondType); ASTMCMapType createMapTypeOf(final Class<?> firstType, final Class<?> secondType); ASTMCMapType createMapTypeOf(final ASTMCType firstType, final ASTMCType secondType); ASTMCMapType createMapTypeOf(final ASTMCTypeArgument firstType, final ASTMCTypeArgument secondType); ASTMCBasicGenericType createBasicGenericTypeOf(final List<String> nameList, List<ASTMCTypeArgument> typeArguments); ASTMCBasicGenericType createBasicGenericTypeOf(final String name, List<ASTMCTypeArgument> typeArguments); ASTMCBasicGenericType createBasicGenericTypeOf(final String name, ASTMCTypeArgument... typeArguments); ASTMCBasicGenericType createBasicGenericTypeOf(final String name, String... typeArgumentStrings); ASTMCArrayType createArrayType(final ASTMCType type, int dimension); ASTMCArrayType createArrayType(final Class<?> clazz, int dimension); ASTMCArrayType createArrayType(final String name, int dimension); ASTMCVoidType createVoidType(); ASTMCPrimitiveType createBooleanType(); boolean isBooleanType(ASTMCType type); ASTMCPrimitiveType createIntType(); ASTMCType createStringType(); }
MCTypeFacade { public ASTMCMapType createMapTypeOf(final String firstType, final String secondType) { return MCFullGenericTypesMill.mCMapTypeBuilder() .setKey(createBasicTypeArgumentOf(firstType)) .setValue(createBasicTypeArgumentOf(secondType)) .build(); } private  MCTypeFacade(); static MCTypeFacade getInstance(); ASTMCQualifiedType createQualifiedType(final Class<?> clazz); ASTMCQualifiedType createQualifiedType(final String name); ASTMCBasicTypeArgument createBasicTypeArgumentOf(String name); ASTMCWildcardTypeArgument createWildCardWithNoBounds(); ASTMCWildcardTypeArgument createWildCardWithUpperBoundType(final Class<?> upperBound); ASTMCWildcardTypeArgument createWildCardWithUpperBoundType(final String upperBound); ASTMCWildcardTypeArgument createWildCardWithUpperBoundType(final ASTMCType upperBound); ASTMCOptionalType createOptionalTypeOf(final String name); ASTMCOptionalType createOptionalTypeOf(final Class<?> clazz); ASTMCOptionalType createOptionalTypeOf(final ASTMCType type); ASTMCOptionalType createOptionalTypeOf(final ASTMCTypeArgument type); ASTMCListType createListTypeOf(final String name); ASTMCListType createListTypeOf(final Class<?> clazz); ASTMCListType createListTypeOf(final ASTMCType type); ASTMCListType createListTypeOf(final ASTMCTypeArgument type); ASTMCSetType createSetTypeOf(final String name); ASTMCSetType createSetTypeOf(final Class<?> clazz); ASTMCSetType createSetTypeOf(final ASTMCType type); ASTMCSetType createSetTypeOf(final ASTMCTypeArgument type); ASTMCGenericType createCollectionTypeOf(final String name); ASTMCGenericType createCollectionTypeOf(final Class<?> clazz); ASTMCGenericType createCollectionTypeOf(final ASTMCType type); ASTMCMapType createMapTypeOf(final String firstType, final String secondType); ASTMCMapType createMapTypeOf(final Class<?> firstType, final Class<?> secondType); ASTMCMapType createMapTypeOf(final ASTMCType firstType, final ASTMCType secondType); ASTMCMapType createMapTypeOf(final ASTMCTypeArgument firstType, final ASTMCTypeArgument secondType); ASTMCBasicGenericType createBasicGenericTypeOf(final List<String> nameList, List<ASTMCTypeArgument> typeArguments); ASTMCBasicGenericType createBasicGenericTypeOf(final String name, List<ASTMCTypeArgument> typeArguments); ASTMCBasicGenericType createBasicGenericTypeOf(final String name, ASTMCTypeArgument... typeArguments); ASTMCBasicGenericType createBasicGenericTypeOf(final String name, String... typeArgumentStrings); ASTMCArrayType createArrayType(final ASTMCType type, int dimension); ASTMCArrayType createArrayType(final Class<?> clazz, int dimension); ASTMCArrayType createArrayType(final String name, int dimension); ASTMCVoidType createVoidType(); ASTMCPrimitiveType createBooleanType(); boolean isBooleanType(ASTMCType type); ASTMCPrimitiveType createIntType(); ASTMCType createStringType();  }