code: @SuppressWarnings("unchecked") private Object formatType(DataType type, Object value)
     {
        switch (type)
        {
           case DATE:
           {
              value = formatDateTime(value);
              break;
           }
  
           case CURRENCY:
           {
              value = formatCurrency((Number) value);
              break;
           }
  
           case UNITS:
           {
              value = formatUnits((Number) value);
              break;
           }
  
           case PERCENTAGE:
           {
              value = formatPercentage((Number) value);
              break;
           }
  
           case ACCRUE:
           {
              value = formatAccrueType((AccrueType) value);
              break;
           }
  
           case CONSTRAINT:
           {
              value = formatConstraintType((ConstraintType) value);
              break;
           }
  
           case WORK:
           case DURATION:
           {
              value = formatDuration(value);
              break;
           }
  
           case RATE:
           {
              value = formatRate((Rate) value);
              break;
           }
  
           case PRIORITY:
           {
              value = formatPriority((Priority) value);
              break;
           }
  
           case RELATION_LIST:
           {
              value = formatRelationList((List<Relation>) value);
              break;
           }
  
           case TASK_TYPE:
           {
              value = formatTaskType((TaskType) value);
              break;
           }
  
           default:
           {
              break;
           }
        }
  
        return (value);
     }
docs: Converts a value to the appropriate type.
  
  @param type target type
  @param value input value
  @return output value