code: public FieldSource<JavaClassSource> addFieldTo(final JavaClassSource targetClass, final String fieldType,
              final String fieldName, Visibility visibility, boolean withGetter, boolean withSetter,
              boolean updateToString,
              String... annotations)
     {
        if (targetClass.hasField(fieldName))
        {
           throw new IllegalStateException("Entity already has a field named [" + fieldName + "]");
        }
        PropertySource<JavaClassSource> property = targetClass.addProperty(fieldType, fieldName);
        FieldSource<JavaClassSource> field = property.getField();
        field.setVisibility(visibility);
        for (String annotation : annotations)
        {
           field.addAnnotation(annotation);
        }
  
        String fieldTypeForImport = Types.stripArray(fieldType);
        if (!fieldTypeForImport.startsWith("java.lang.") && fieldTypeForImport.contains(".")
                 && !fieldTypeForImport.equals(targetClass.getCanonicalName()))
        {
           targetClass.addImport(fieldTypeForImport);
        }
        if (!withGetter)
        {
           targetClass.removeMethod(property.getAccessor());
        }
        if (!withSetter)
        {
           targetClass.removeMethod(property.getMutator());
        }
        if (updateToString)
        {
           updateToString(targetClass);
        }
  
        return field;
     }
docs: Adds the field, updating the toString(). If specified, adds a getter, a setter or both.
  
  @param targetClass The class which the field will be added to
  @param fieldType The type of the field
  @param fieldName The name of the field
  @param visibility The visibility of the newly created field
  @param withGetter Specifies whether accessor method should be created
  @param withSetter Specifies whether mutator method should be created
  @param updateToString Specifies whether the field should be added in the toString method
  @param annotations An optional list of annotations that will be added to the field
  @return The newly created field