Add a field to the class.

@param fieldName the name of the field
@param type the type of the field using ...
@param flags the attributes of the field, such as ACC_PUBLIC, etc. bitwise or'd together
344379
public void addField(String fieldName, String type, short flags) {
        short fieldNameIndex = itsConstantPool.addUtf8(fieldName);
        short typeIndex = itsConstantPool.addUtf8(type);
        itsFields.add(new ClassFileField(fieldNameIndex, typeIndex, flags));
    }
37767
private void setField(Field field, Object object, Class<?> type)
    {
        try
        {
            if (field.get(object) == null)
            {
                final Class<? extends Feature> clazz;
                // CHECKSTYLE IGNORE LINE: InnerAssignment
                if (Feature.class.isAssignableFrom(type) && hasFeature(clazz = type.asSubclass(Feature.class)))
                {
                    field.set(object, getFeature(clazz));
                }
                else if (media != null)
                {
                    throw new LionEngineException(media, ERROR_CLASS_PRESENCE + String.valueOf(type) + IN + object);
                }
                else
                {
                    throw new LionEngineException(ERROR_CLASS_PRESENCE + String.valueOf(type) + IN + object);
                }
            }
        }
        catch (final IllegalAccessException exception)
        {
            throw new LionEngineException(exception,
                                          ERROR_INJECT + type.getSimpleName() + Constant.SLASH + field.getName());
        }
    }
1121844
public void field(String type, String name, int modifiers) throws IOException {
    field(type, name, modifiers, null);
  }
1176755
public UserDefinedTypeBuilder withField(CqlIdentifier name, DataType type) {
    fieldNames.add(name);
    fieldTypes.add(type);
    return this;
  }
480980
public function addField($fieldName, Field $field)
    {
        $this->fieldNames[ $fieldName ] = $fieldName;
        $this->fields[ $fieldName ]     = $field;

        return $fieldName;
    }
675720
@XmlAttribute(name="name", required=true)
    public void setFieldName(final String fieldName) {
        ArgUtils.notEmpty(fieldName, "fieldName");
        this.fieldName = fieldName;
    }
72438
public static void addFieldValue(List<FieldMeta> fieldValues,String fieldName,Object value){
		FieldMeta fieldMeta = new FieldMeta();
		fieldMeta.setEsFieldName(fieldName);
		fieldMeta.setValue(value);
		fieldValues.add(fieldMeta);
	}
550266
@Nonnull
    public BugInstance addField(FieldVariable field) {
        return addField(field.getClassName(), field.getFieldName(), field.getFieldSig(), field.isStatic());
    }
1095855
public void addFieldParser(char type, SdpParser<? extends SdpField> parser) {
		synchronized (this.fieldParsers) {
			this.fieldParsers.put(type, parser);
		}
	}
1349334
public function addField(
        $fieldOrName,
        $classes = [],
        string $type = null,
        $value = null,
        string $title = null
    ) : self {
        if (!$fieldOrName instanceof Field) {
            $fieldOrName = new Field(
                $fieldOrName,
                is_array($classes) ? $classes : [$classes],
                $type,
                $value,
                $title
            );
        }

        $this->fields[] = $fieldOrName;

        return $this;
    }
488011
public static void setFieldIfPossible(Class type, String name, Object value) {
        Optional<Field> declaredField = findDeclaredField(type, name);
        if (declaredField.isPresent()) {
            Field field = declaredField.get();
            Optional<?> converted = ConversionService.SHARED.convert(value, field.getType());
            if (converted.isPresent()) {
                field.setAccessible(true);
                try {
                    field.set(type, converted.get());
                } catch (IllegalAccessException e) {
                    // ignore
                }
            } else {
                field.setAccessible(true);
                try {
                    field.set(type, null);
                } catch (IllegalAccessException e) {
                    // ignore
                }
            }
        }
    }
1171672
public void loadField(String fieldName,
                          TypeDesc type) {
        getfield(0, Opcode.GETFIELD, constantField(fieldName, type), type);
    }
1308830
void addField(final String name, final boolean value)
            throws IllegalStateException {

        addField(name, Boolean.toString(value));

    }
868617
public boolean declaresField(Field field) {
        try {
            type.getDeclaredField(field.getName());
            return true;
        }
        catch (NoSuchFieldException e) {
            return false;
        }
    }
182462
public void addValueToField(String fieldName, Object value) {
		add(new SimpleUpdateField(fieldName, value, UpdateAction.ADD));
	}
64461
public static FieldCoordinates systemCoordinates(String fieldName) {
        assertTrue(fieldName.startsWith("__"), "Only __ system fields can be addressed without a parent type");
        assertValidName(fieldName);
        return new FieldCoordinates(null, fieldName);
    }
1366535
public void add(final FieldDescriptor type, final Message defaultInstance) {
    if (type.getJavaType() != FieldDescriptor.JavaType.MESSAGE) {
      throw new IllegalArgumentException(
        "ExtensionRegistry.add() provided a default instance for a " +
        "non-message extension.");
    }
    add(new ExtensionInfo(type, defaultInstance));
  }