@Test(expected = IllegalArgumentException.class) public void addEnclosingTransferObjectArgumentTest() { CodegenGeneratedTypeBuilder generatedTypeBuilder = new CodegenGeneratedTypeBuilder( JavaTypeName.create("my.package", "MyName")); generatedTypeBuilder.addEnclosingTransferObject(new CodegenGeneratedTOBuilder( JavaTypeName.create("my.package", "myName"))); generatedTypeBuilder.addEnclosingTransferObject(new CodegenGeneratedTOBuilder( JavaTypeName.create("my.package", "myName"))); }
@Override public GeneratedTOBuilder addEnclosingTransferObject(final String name) { checkArgument(name != null, "Name for Enclosing Generated Transfer Object cannot be null!"); final GeneratedTOBuilder builder = new CodegenGeneratedTOBuilder(getIdentifier().createEnclosed(name)); checkArgument(!enclosedTransferObjects.contains(builder), "This generated type already contains equal enclosing transfer object."); this.enclosedTransferObjects = LazyCollections.lazyAdd(this.enclosedTransferObjects, builder); return builder; }
AbstractGeneratedTypeBuilder extends AbstractBaseType implements GeneratedTypeBuilderBase<T> { @Override public GeneratedTOBuilder addEnclosingTransferObject(final String name) { checkArgument(name != null, "Name for Enclosing Generated Transfer Object cannot be null!"); final GeneratedTOBuilder builder = new CodegenGeneratedTOBuilder(getIdentifier().createEnclosed(name)); checkArgument(!enclosedTransferObjects.contains(builder), "This generated type already contains equal enclosing transfer object."); this.enclosedTransferObjects = LazyCollections.lazyAdd(this.enclosedTransferObjects, builder); return builder; } }
AbstractGeneratedTypeBuilder extends AbstractBaseType implements GeneratedTypeBuilderBase<T> { @Override public GeneratedTOBuilder addEnclosingTransferObject(final String name) { checkArgument(name != null, "Name for Enclosing Generated Transfer Object cannot be null!"); final GeneratedTOBuilder builder = new CodegenGeneratedTOBuilder(getIdentifier().createEnclosed(name)); checkArgument(!enclosedTransferObjects.contains(builder), "This generated type already contains equal enclosing transfer object."); this.enclosedTransferObjects = LazyCollections.lazyAdd(this.enclosedTransferObjects, builder); return builder; } protected  AbstractGeneratedTypeBuilder(final JavaTypeName identifier); }
AbstractGeneratedTypeBuilder extends AbstractBaseType implements GeneratedTypeBuilderBase<T> { @Override public GeneratedTOBuilder addEnclosingTransferObject(final String name) { checkArgument(name != null, "Name for Enclosing Generated Transfer Object cannot be null!"); final GeneratedTOBuilder builder = new CodegenGeneratedTOBuilder(getIdentifier().createEnclosed(name)); checkArgument(!enclosedTransferObjects.contains(builder), "This generated type already contains equal enclosing transfer object."); this.enclosedTransferObjects = LazyCollections.lazyAdd(this.enclosedTransferObjects, builder); return builder; } protected  AbstractGeneratedTypeBuilder(final JavaTypeName identifier); @Override boolean isAbstract(); @Override List<Type> getImplementsTypes(); @Override List<MethodSignatureBuilder> getMethodDefinitions(); @Override GeneratedTOBuilder addEnclosingTransferObject(final String name); @Override T addEnclosingTransferObject(final GeneratedTOBuilder genTOBuilder); @Override T addComment(final TypeComment newComment); @Override AnnotationTypeBuilder addAnnotation(final JavaTypeName identifier); @Override T setAbstract(final boolean newIsAbstract); @Override T addImplementsType(final Type genType); @Override Constant addConstant(final Type type, final String name, final Object value); boolean containsConstant(final String name); @Override EnumBuilder addEnumeration(final String name); @Override MethodSignatureBuilder addMethod(final String name); @Override boolean containsMethod(final String name); @Override GeneratedPropertyBuilder addProperty(final String name); @Override boolean containsProperty(final String name); Type getParent(); @Override List<GeneratedPropertyBuilder> getProperties(); @Override Optional<YangSourceDefinition> getYangSourceDefinition(); @Override void setYangSourceDefinition(final YangSourceDefinition definition); }
AbstractGeneratedTypeBuilder extends AbstractBaseType implements GeneratedTypeBuilderBase<T> { @Override public GeneratedTOBuilder addEnclosingTransferObject(final String name) { checkArgument(name != null, "Name for Enclosing Generated Transfer Object cannot be null!"); final GeneratedTOBuilder builder = new CodegenGeneratedTOBuilder(getIdentifier().createEnclosed(name)); checkArgument(!enclosedTransferObjects.contains(builder), "This generated type already contains equal enclosing transfer object."); this.enclosedTransferObjects = LazyCollections.lazyAdd(this.enclosedTransferObjects, builder); return builder; } protected  AbstractGeneratedTypeBuilder(final JavaTypeName identifier); @Override boolean isAbstract(); @Override List<Type> getImplementsTypes(); @Override List<MethodSignatureBuilder> getMethodDefinitions(); @Override GeneratedTOBuilder addEnclosingTransferObject(final String name); @Override T addEnclosingTransferObject(final GeneratedTOBuilder genTOBuilder); @Override T addComment(final TypeComment newComment); @Override AnnotationTypeBuilder addAnnotation(final JavaTypeName identifier); @Override T setAbstract(final boolean newIsAbstract); @Override T addImplementsType(final Type genType); @Override Constant addConstant(final Type type, final String name, final Object value); boolean containsConstant(final String name); @Override EnumBuilder addEnumeration(final String name); @Override MethodSignatureBuilder addMethod(final String name); @Override boolean containsMethod(final String name); @Override GeneratedPropertyBuilder addProperty(final String name); @Override boolean containsProperty(final String name); Type getParent(); @Override List<GeneratedPropertyBuilder> getProperties(); @Override Optional<YangSourceDefinition> getYangSourceDefinition(); @Override void setYangSourceDefinition(final YangSourceDefinition definition);  }