Determines if this value is the default value for the given field type.

@param type field type
@param value value
@return true if the value is not default
160882
public static final boolean valueIsNotDefault(FieldType type, Object value)
   {
      boolean result = true;

      if (value == null)
      {
         result = false;
      }
      else
      {
         DataType dataType = type.getDataType();
         switch (dataType)
         {
            case BOOLEAN:
            {
               result = ((Boolean) value).booleanValue();
               break;
            }

            case CURRENCY:
            case NUMERIC:
            {
               result = !NumberHelper.equals(((Number) value).doubleValue(), 0.0, 0.00001);
               break;
            }

            case DURATION:
            {
               result = (((Duration) value).getDuration() != 0);
               break;
            }

            default:
            {
               break;
            }
         }
      }

      return result;
   }
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
                }
            }
        }
    }
392894
public void addField(String name, Object value, Object type) {
        if (value == null) {
            this.fields.add(new Field(name, null, null));
        } else {
            this.fields.add(new Field(name, value.toString(), type.toString()));
        }
    }
445009
public static function isTypeOf($value, $type) {
        switch ($type) {
            case self::ARGUMENT_ARRAY:
                ArrayHelper::isArray($value);
                break;
            case self::ARGUMENT_BOOLEAN:
                BooleanHelper::isBoolean($value);
                break;
            case self::ARGUMENT_DATE:
                DateTimeHelper::isDate($value);
                break;
            case self::ARGUMENT_DOUBLE:
                DoubleHelper::isDouble($value);
                break;
            case self::ARGUMENT_FLOAT:
                FloatHelper::isFloat($value);
                break;
            case self::ARGUMENT_INTEGER:
                IntegerHelper::isInteger($value);
                break;
            case self::ARGUMENT_NUMBER:
                NumberHelper::isNumber($value);
                break;
            case self::ARGUMENT_OBJECT:
                ObjectHelper::isObject($value);
                break;
            case self::ARGUMENT_RESOURCE:
                ResourceHelper::isResource($value);
                break;
            case self::ARGUMENT_STRING:
                StringHelper::isString($value);
                break;
            case self::ARGUMENT_TIMESTAMP:
                TimestampHelper::isTimestamp($value);
                break;
            default:
                throw new IllegalArgumentException("The type \"" . $type . "\" is not implemented");
        }
        return true;
    }
297619
public static void setField(Class<?> type, String fieldName, Object fieldValue) {
		setField(null, type, fieldName, fieldValue);
	}
885847
public static boolean isValueReference(String value)
    {
        if (value == null)
        {
            throw new NullPointerException("value");
        }

        int start = value.indexOf("#{");
        if (start < 0)
        {
            return false;
        }

        int end = value.lastIndexOf('}');
        return (end >= 0 && start < end);
    }
804599
protected Object getTypedValue(int type, byte[] value)
   {
      Object result;

      switch (type)
      {
         case 4: // Date
         {
            result = MPPUtility.getTimestamp(value, 0);
            break;
         }

         case 6: // Duration
         {
            TimeUnit units = MPPUtility.getDurationTimeUnits(MPPUtility.getShort(value, 4), m_properties.getDefaultDurationUnits());
            result = MPPUtility.getAdjustedDuration(m_properties, MPPUtility.getInt(value, 0), units);
            break;
         }

         case 9: // Cost
         {
            result = Double.valueOf(MPPUtility.getDouble(value, 0) / 100);
            break;
         }

         case 15: // Number
         {
            result = Double.valueOf(MPPUtility.getDouble(value, 0));
            break;
         }

         case 36058:
         case 21: // Text
         {
            result = MPPUtility.getUnicodeString(value, 0);
            break;
         }

         default:
         {
            result = value;
            break;
         }
      }

      return result;
   }
885240
@Override
    boolean valuesAreTheSameAsDefault()
    {
        if (getDefaultValues() == null || getDefaultValues().size() == 0)
            return false;
        if (getValues() == null || getValues().size() == 0)
            return false;
        if (getDefaultValues().size() != getValues().size())
            return false;
        for (int v = 0; v < getDefaultValues().size(); v++)
        {
            if (isCaseSensitive() && !getDefaultValues().get(v).equals(getValues().get(v)))
                return false;
            if (!isCaseSensitive() && !getDefaultValues().get(v).equalsIgnoreCase(getValues().get(v)))
                return false;
        }
        return true;
    }
1004934
public static boolean isTypeWrappedPrimitive(TypeName value) {
		return isTypeIncludedIn(value, Byte.class, Character.class, Boolean.class, Short.class, Integer.class,
				Long.class, Float.class, Double.class);
	}
621988
public static Object getPrimitiveDefaultValue(final Class<?> type) {
        
        Objects.requireNonNull(type, "type should not be null.");
        
        if(!type.isPrimitive()) {
            return null;
            
        } else if(boolean.class.isAssignableFrom(type)) {
            return false;
            
        } else if(char.class.isAssignableFrom(type)) {
            return '\u0000';
            
        } else if(byte.class.isAssignableFrom(type)) {
            return (byte)0;
            
        } else if(short.class.isAssignableFrom(type)) {
            return (short)0;
            
        } else if(int.class.isAssignableFrom(type)) {
            return 0;
            
        } else if(long.class.isAssignableFrom(type)) {
            return 0l;
            
        } else if(float.class.isAssignableFrom(type)) {
            return 0.0f;
            
        } else if(double.class.isAssignableFrom(type)) {
            return 0.0d;
        }
        
        return null;
        
    }
798735
public void setType(TYPE type) {
    if(type == null) {
      type = TYPE.UNSET;
    }
    this.type = type;
  }
1331289
public static void checkTypeConsistency(Schema schema, String fieldName,
      Object... values) {
    checkTypeConsistency(schema, null, fieldName, values);
  }
821176
public boolean isType(final org.efaps.admin.datamodel.Type _type)
    {
        return getType().equals(_type);
    }
831262
function checkType(value, type) {
  if (typeof type === 'string') {
    switch (type) {
      case 'string':
      case 'object':
      case 'number':
      case 'boolean':
      case 'function':
        return typeof value === type;
      case 'class':
        return typeof value === 'function';
      case 'array':
        return value.constructor === Array;
      default:
        return false;
    }
  }
  else {
    return value instanceof type;
  }
}
463720
public void setType(String type) {
    if(StringUtils.isBlank(type)) {
      setType(TYPE.UNSET);
    }
    else {
      if(TYPE.NEGATIVE.toString().equalsIgnoreCase(type.trim())) {
        setType(TYPE.NEGATIVE);
      }
      if(TYPE.NEUTRAL.toString().equalsIgnoreCase(type.trim())) {
        setType(TYPE.NEUTRAL);
      }
      if(TYPE.POSITIVE.toString().equalsIgnoreCase(type.trim())) {
        setType(TYPE.POSITIVE);
      }
      if(TYPE.UNSET.toString().equalsIgnoreCase(type.trim())) {
        setType(TYPE.UNSET);
      }
    }
  }
456403
@Override
	public boolean containsValue(Object value) {
		return this.groupedMap.containsValue(DEFAULT_GROUP, Convert.toStr(value));
	}
755808
private boolean getBooleanValue(final Value value, final boolean defaultValue) {

		if (value != null && value instanceof BooleanValue) {

			return ((BooleanValue)value).isValue();
		}

		return defaultValue;
	}