return new WildcardTypeImpl(identifier);
}
- /**
- * Creates instance of
- * {@link org.opendaylight.mdsal.binding.model.api.ParameterizedType
- * ParameterizedType} where raw type is
- * {@link org.opendaylight.yangtools.yang.binding.Augmentable} and actual
- * parameter is <code>valueType</code>.
- *
- * @param valueType JAVA <code>Type</code> with actual parameter
- * @return <code>ParametrizedType</code> representation of raw type
- * <code>Augmentable</code> with actual parameter
- * <code>valueType</code>
- * @deprecated Use {@link BindingTypes#augmentable(Type)} instead.
- */
- @Deprecated(forRemoval = true)
- public static @NonNull ParameterizedType augmentableTypeFor(final Type valueType) {
- return BindingTypes.augmentable(valueType);
- }
-
- /**
- * Creates instance of {@link org.opendaylight.mdsal.binding.model.api.ParameterizedType ParameterizedType} where
- * raw type is {@link org.opendaylight.yangtools.yang.binding.Augmentation} and actual parameter
- * is <code>valueType</code>.
- *
- * @param valueType JAVA <code>Type</code> with actual parameter
- * @return <code>ParametrizedType</code> representation of raw type
- * <code>Augmentation</code> with actual parameter
- * <code>valueType</code>
- * @deprecated Use {@link BindingTypes#augmentation(Type)} instead.
- */
- @Deprecated(forRemoval = true)
- public static @NonNull ParameterizedType augmentationTypeFor(final Type valueType) {
- return BindingTypes.augmentation(valueType);
- }
-
public static @Nullable String getOuterClassName(final Type valueType) {
return valueType.getIdentifier().immediatelyEnclosingClass().map(Object::toString).orElse(null);
}
"WildcardTypeTest"));
assertEquals("WildcardTypeTest", wildcardType.getName());
}
-
- @Deprecated
- @Test(expected = NullPointerException.class)
- public void testAugmentableTypeForNull() {
- Types.augmentableTypeFor(null);
- }
-
- @Deprecated
- @Test(expected = NullPointerException.class)
- public void augmentationTypeForNull() {
- Types.augmentationTypeFor(null);
- }
-
- @Deprecated
- @Test
- public void testAugmentableTypeFor() {
- ParameterizedType augmentableType = Types.augmentableTypeFor(Types.objectType());
- assertEquals("Augmentable", augmentableType.getName());
- }
-
- @Deprecated
- @Test
- public void augmentationTypeFor() {
- ParameterizedType augmentationType = Types.augmentationTypeFor(Types.objectType());
- assertEquals("Augmentation", augmentationType.getName());
- }
}
import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
import org.opendaylight.mdsal.binding.model.api.type.builder.GeneratedTypeBuilder;
import org.opendaylight.mdsal.binding.model.util.BindingTypes;
-import org.opendaylight.mdsal.binding.model.util.Types;
import org.opendaylight.mdsal.binding.model.util.generated.type.builder.CodegenGeneratedTypeBuilder;
public class GeneratorJavaFileTest extends BaseCompilationTest {
public void test() throws IOException {
final GeneratedTypeBuilder gtb = new CodegenGeneratedTypeBuilder(JavaTypeName.create(
"org.opendaylight.controller.gen", "Type4"));
- gtb.addImplementsType(Types.augmentableTypeFor(gtb));
+ gtb.addImplementsType(BindingTypes.augmentable(gtb));
generateTestSources(Arrays.asList(
createGeneratedType("org.opendaylight.controller.gen", "Type1"),