Adds a user defined field value to a task.

@param fieldType field type
@param container FieldContainer instance
@param row UDF data
507017
private void addUDFValue(FieldTypeClass fieldType, FieldContainer container, Row row)
   {
      Integer fieldId = row.getInteger("udf_type_id");
      String fieldName = m_udfFields.get(fieldId);

      Object value = null;
      FieldType field = m_project.getCustomFields().getFieldByAlias(fieldType, fieldName);
      if (field != null)
      {
         DataType fieldDataType = field.getDataType();

         switch (fieldDataType)
         {
            case DATE:
            {
               value = row.getDate("udf_date");
               break;
            }

            case CURRENCY:
            case NUMERIC:
            {
               value = row.getDouble("udf_number");
               break;
            }

            case GUID:
            case INTEGER:
            {
               value = row.getInteger("udf_code_id");
               break;
            }

            case BOOLEAN:
            {
               String text = row.getString("udf_text");
               if (text != null)
               {
                  // before a normal boolean parse, we try to lookup the text as a P6 static type indicator UDF
                  value = STATICTYPE_UDF_MAP.get(text);
                  if (value == null)
                  {
                     value = Boolean.valueOf(row.getBoolean("udf_text"));
                  }
               }
               else
               {
                  value = Boolean.valueOf(row.getBoolean("udf_number"));
               }
               break;
            }

            default:
            {
               value = row.getString("udf_text");
               break;
            }
         }

         container.set(field, value);
      }
   }
772579
private void populateField(FieldContainer container, FieldType target, FieldType... types)
   {
      for (FieldType type : types)
      {
         Object value = container.getCachedValue(type);
         if (value != null)
         {
            container.set(target, value);
            break;
         }
      }
   }
631215
private void _add(String fieldName, IonValueLite child)
    {
        hasNullFieldName |= fieldName == null;
        int size = get_child_count();

        // add this to the Container child collection
        add(size, child);

        // if we have a hash map we need to update it now
        if (_field_map != null) {
            add_field(fieldName, child._elementid());
        }
    }
310599
public void put(Field field, Class<?> arrayComponentType, Object value) {
    ArrayValueMap.ArrayValue arrayValue = fieldMap.get(field);
    if (arrayValue == null) {
      arrayValue = new ArrayValue(arrayComponentType);
      fieldMap.put(field, arrayValue);
    }
    arrayValue.addValue(arrayComponentType, value);
  }
1122704
public void add(String key, Object value) {
    validFieldName(key);
    ObjectFieldOperation op = OperationBuilder.gBuilder.create(OperationBuilder.OperationType.Add, key, value);
    addNewOperation(op);
  }
95494
public void addField(String fieldName, TypeID tid) {
    sTid.getFieldTypeInfos().add(new FieldTypeInfo(fieldName, tid));
  }
114020
private static void defineField(Map<String, FieldType> container, String name, FieldType type)
   {
      defineField(container, name, type, null);
   }
180230
public void addType(String resourceType) {

        m_searchObject.addType(resourceType);
        m_searchObjectChanged = true;
        ValueChangeEvent.fire(this, m_searchObject);
    }
20722
private void set(FieldType field, boolean value)
   {
      set(field, (value ? Boolean.TRUE : Boolean.FALSE));
   }
1347731
public void setFieldValue(String fieldName, Object value) {
		DOField field = this.domainObjectType.getFieldByName(fieldName);
		if (field == null)
			throw new RuntimeException("field: " + fieldName + " not found in: " + this.domainObjectType.getName());
		if (field.getComponentTypeName() != null)
			throw new RuntimeException("field: " + fieldName + " is a list field, use list field accessors instead ");
		Object val = value;
		if (value instanceof DomainObject)
			val = ((DomainObject)value).getRawObject();
		field.setValue(this.getRawObject(), val);
	}
393377
protected void processField(Row row, String fieldIDColumn, Integer entityID, Object value)
   {
      int fieldID = row.getInt(fieldIDColumn);

      int prefix = fieldID & 0xFFFF0000;
      int index = fieldID & 0x0000FFFF;

      switch (prefix)
      {
         case MPPTaskField.TASK_FIELD_BASE:
         {
            TaskField field = MPPTaskField.getInstance(index);
            if (field != null && field != TaskField.NOTES)
            {
               Task task = m_project.getTaskByUniqueID(entityID);
               if (task != null)
               {
                  if (field.getDataType() == DataType.CURRENCY)
                  {
                     value = Double.valueOf(((Double) value).doubleValue() / 100);
                  }
                  task.set(field, value);
               }
            }
            break;
         }

         case MPPResourceField.RESOURCE_FIELD_BASE:
         {
            ResourceField field = MPPResourceField.getInstance(index);
            if (field != null && field != ResourceField.NOTES)
            {
               Resource resource = m_project.getResourceByUniqueID(entityID);
               if (resource != null)
               {
                  if (field.getDataType() == DataType.CURRENCY)
                  {
                     value = Double.valueOf(((Double) value).doubleValue() / 100);
                  }
                  resource.set(field, value);
               }
            }
            break;
         }

         case MPPAssignmentField.ASSIGNMENT_FIELD_BASE:
         {
            AssignmentField field = MPPAssignmentField.getInstance(index);
            if (field != null && field != AssignmentField.NOTES)
            {
               ResourceAssignment assignment = m_assignmentMap.get(entityID);
               if (assignment != null)
               {
                  if (field.getDataType() == DataType.CURRENCY)
                  {
                     value = Double.valueOf(((Double) value).doubleValue() / 100);
                  }
                  assignment.set(field, value);
               }
            }

            break;
         }
      }
   }
867688
private List<UDFAssignmentType> writeUDFType(FieldTypeClass type, FieldContainer mpxj)
   {
      List<UDFAssignmentType> out = new ArrayList<UDFAssignmentType>();
      for (CustomField cf : m_sortedCustomFieldsList)
      {
         FieldType fieldType = cf.getFieldType();
         if (fieldType != null && type == fieldType.getFieldTypeClass())
         {
            Object value = mpxj.getCachedValue(fieldType);
            if (FieldTypeHelper.valueIsNotDefault(fieldType, value))
            {
               UDFAssignmentType udf = m_factory.createUDFAssignmentType();
               udf.setTypeObjectId(FieldTypeHelper.getFieldID(fieldType));
               setUserFieldValue(udf, fieldType.getDataType(), value);
               out.add(udf);
            }
         }
      }
      return out;
   }
240256
public void insertRow(Object rowHandle, Object... fieldList)  throws InterruptedException {
        int partitionId = 0;
        //Find partition to send this row to and put on correct PerPartitionTable.
        if (fieldList == null || fieldList.length <= 0) {
            String errMsg;
            if (rowHandle == null)
                errMsg = "Error: insertRow received empty fieldList";
            else
                errMsg = "Error: insertRow received empty fieldList for row: " + rowHandle.toString();
            generateError(rowHandle, fieldList, errMsg);
            return;
        }
        if (fieldList.length != m_columnCnt) {
            String errMsg;
            if (rowHandle == null)
                errMsg = "Error: insertRow received incorrect number of columns; " + fieldList.length +
                        " found, " + m_columnCnt + " expected";
            else
                errMsg = "Error: insertRow received incorrect number of columns; " + fieldList.length +
                        " found, " + m_columnCnt + " expected for row: " + rowHandle.toString();
            generateError(rowHandle, fieldList, errMsg);
            return;
        }
        VoltBulkLoaderRow newRow = new VoltBulkLoaderRow(this, rowHandle, fieldList);
        if (m_isMP) {
            m_partitionTable[m_firstPartitionTable].insertRowInTable(newRow);
        }
        else {
            try {
                partitionId = (int)m_clientImpl.getPartitionForParameter(
                        m_partitionColumnType.getValue(), fieldList[m_partitionedColumnIndex]);
                m_partitionTable[partitionId].insertRowInTable(newRow);
            } catch (VoltTypeException e) {
                generateError(rowHandle, fieldList, e.getMessage());
                return;
            }
        }
        m_outstandingRowCount.incrementAndGet();
    }
699850
public static void addItemToList(final Object target, final String fieldName, final Object value) {
		try {
			List list = (List) getFieldValue(target, fieldName);
			list.add(value);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
490742
private void writeFields(String objectName, FieldContainer container, FieldType[] fields) throws IOException
   {
      m_writer.writeStartObject(objectName);
      for (FieldType field : fields)
      {
         Object value = container.getCurrentValue(field);
         if (value != null)
         {
            writeField(field, value);
         }
      }
      m_writer.writeEndObject();
   }
653573
private void setUserFieldValue(UDFAssignmentType udf, DataType dataType, Object value)
   {
      switch (dataType)
      {
         case DURATION:
         {
            udf.setTextValue(((Duration) value).toString());
            break;
         }

         case CURRENCY:
         {
            if (!(value instanceof Double))
            {
               value = Double.valueOf(((Number) value).doubleValue());
            }
            udf.setCostValue((Double) value);
            break;
         }

         case BINARY:
         {
            udf.setTextValue("");
            break;
         }

         case STRING:
         {
            udf.setTextValue((String) value);
            break;
         }

         case DATE:
         {
            udf.setStartDateValue((Date) value);
            break;
         }

         case NUMERIC:
         {
            if (!(value instanceof Double))
            {
               value = Double.valueOf(((Number) value).doubleValue());
            }
            udf.setDoubleValue((Double) value);
            break;
         }

         case BOOLEAN:
         {
            udf.setIntegerValue(BooleanHelper.getBoolean((Boolean) value) ? Integer.valueOf(1) : Integer.valueOf(0));
            break;
         }

         case INTEGER:
         case SHORT:
         {
            udf.setIntegerValue(NumberHelper.getInteger((Number) value));
            break;
         }

         default:
         {
            throw new RuntimeException("Unconvertible data type: " + dataType);
         }
      }
   }
356462
public static void setFieldValue(Object obj, String fieldName, Object value) throws UtilException {
		Assert.notNull(obj);
		Assert.notBlank(fieldName);
		setFieldValue(obj, getField(obj.getClass(), fieldName), value);
	}