@Test(expected = IllegalArgumentException.class) public void addPropertyIllegalArgumentTest() { CodegenGeneratedTypeBuilder generatedTypeBuilder = new CodegenGeneratedTypeBuilder( JavaTypeName.create("my.package", "MyName")); generatedTypeBuilder.addProperty(null); }
@Override public GeneratedPropertyBuilder addProperty(final String name) { checkArgument(name != null, "Parameter name can't be null"); checkArgument(!containsProperty(name), "This generated type already contains property with the same name."); final GeneratedPropertyBuilder builder = new GeneratedPropertyBuilderImpl(name); builder.setAccessModifier(AccessModifier.PUBLIC); this.properties = LazyCollections.lazyAdd(this.properties, builder); return builder; }
AbstractGeneratedTypeBuilder extends AbstractBaseType implements GeneratedTypeBuilderBase<T> { @Override public GeneratedPropertyBuilder addProperty(final String name) { checkArgument(name != null, "Parameter name can't be null"); checkArgument(!containsProperty(name), "This generated type already contains property with the same name."); final GeneratedPropertyBuilder builder = new GeneratedPropertyBuilderImpl(name); builder.setAccessModifier(AccessModifier.PUBLIC); this.properties = LazyCollections.lazyAdd(this.properties, builder); return builder; } }
AbstractGeneratedTypeBuilder extends AbstractBaseType implements GeneratedTypeBuilderBase<T> { @Override public GeneratedPropertyBuilder addProperty(final String name) { checkArgument(name != null, "Parameter name can't be null"); checkArgument(!containsProperty(name), "This generated type already contains property with the same name."); final GeneratedPropertyBuilder builder = new GeneratedPropertyBuilderImpl(name); builder.setAccessModifier(AccessModifier.PUBLIC); this.properties = LazyCollections.lazyAdd(this.properties, builder); return builder; } protected  AbstractGeneratedTypeBuilder(final JavaTypeName identifier); }
AbstractGeneratedTypeBuilder extends AbstractBaseType implements GeneratedTypeBuilderBase<T> { @Override public GeneratedPropertyBuilder addProperty(final String name) { checkArgument(name != null, "Parameter name can't be null"); checkArgument(!containsProperty(name), "This generated type already contains property with the same name."); final GeneratedPropertyBuilder builder = new GeneratedPropertyBuilderImpl(name); builder.setAccessModifier(AccessModifier.PUBLIC); this.properties = LazyCollections.lazyAdd(this.properties, 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 GeneratedPropertyBuilder addProperty(final String name) { checkArgument(name != null, "Parameter name can't be null"); checkArgument(!containsProperty(name), "This generated type already contains property with the same name."); final GeneratedPropertyBuilder builder = new GeneratedPropertyBuilderImpl(name); builder.setAccessModifier(AccessModifier.PUBLIC); this.properties = LazyCollections.lazyAdd(this.properties, 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);  }