{@inheritdoc}

In case, when the [[value]] property is `null`, the value of [[defaultValue]] will be used as the value.
2628
protected function getValue($event)
    {
        if ($this->value === null && Yii::getApp()->has('user')) {
            $userId = Yii::getApp()->get('user')->id;
            if ($userId === null) {
                return $this->getDefaultValue($event);
            }

            return $userId;
        }

        return parent::getValue($event);
    }
317488
private function getValuesAsArray()
    {
        if ($this->value === null) {
            return is_array($this->defaultValue) 
                ? $this->defaultValue 
                : [ $this->defaultValue ];
        }
        return $this->value;
    }
1075862
function(obj, desc, defaultValue) {
        var arr = desc.split('.');
        try {
            while (arr.length) {
                obj = _get_simple(obj, arr.shift());
            }
        } catch(ex) {
            /* invalid chain */
            obj = undefined;
        }
        return obj === undefined ? defaultValue : obj;
    }
1287780
public T orElse(T defaultValue) {
        T value = get();

        if (value != null) {
            return value;
        }

        return defaultValue;
    }
316266
public function setDefaultValue(QtiDatatype $defaultValue = null)
    {
        if (Utils::isBaseTypeCompliant($this->getBaseType(), $defaultValue) && Utils::isCardinalityCompliant($this->getCardinality(), $defaultValue)) {
            $this->defaultValue = $defaultValue;

            return;
        } else {
            Utils::throwBaseTypeTypingError($this->getBaseType(), $defaultValue);
        }
    }
446855
@Override
	protected String initValuesImpl(final FieldCase ca) {
		String keyValue = keyConstraint.initValues(ca);
		selectedConstraint = map.get(keyValue);
		if (selectedConstraint == null) {
			selectedConstraint = map.get(DEFAULT_KEY);
		}
		if (selectedConstraint != null) {
			return selectedConstraint.initValues(ca);
		}
		return null;
	}
751089
public String[] getStringsWithDefault(String key, String[] defaultValue) {
		String[] value = getStrings(key, null);
		if (null == value) {
			value = defaultValue;
		}

		return value;
	}
368342
@Nullable
	public static Boolean valueOrPropertyAsBoolean(@Nullable final Boolean value, @Nonnull final Property property, @Nullable final Boolean defaultValue) {
		return SimpleConversions.convertToBoolean(valueOrProperty(value, property, defaultValue));
	}
591538
public static <T> T getOrDefaultValue(String primaryKey, T defaultValue) {
        Object val = CFG.get(primaryKey);
        return val == null ? defaultValue : (T) CompatibleTypeUtils.convert(val, defaultValue.getClass());
    }
1137488
private String[] remove(String name, String[] defaultValue) throws SQLException {
        String[] value = null;

        for (int diff; value == null && entry != null && (diff = entry.getKey().compareTo(name)) <= 0; entry = entries.pollFirstEntry()) {
            if (diff == 0) // matched
                value = entry.getValue() instanceof String[] ? (String[]) entry.getValue() : new String[] { (String) entry.getValue() };
            else {
                // TODO: when we have a stricter variant of onError, apply it to unrecognized attributes
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(this, tc, "unrecognized attribute: " + entry.getKey());
                //SQLException ex = AdapterUtil.ignoreWarnOrFail(tc, null, SQLException.class, "PROP_NOT_FOUND", jndiName == null ? id : jndiName, entry.getKey());
                //if (ex != null)
                //    throw ex;
            }
        }

        return value == null ? defaultValue : value;
    }
794669
public static <T> T selectValue(T defaultValue, T... overrides) {
        for (T override : overrides) {
            if (override != null) {
                return override;
            }
        }
        return defaultValue;
    }
1162063
public function setPropertyValue($property, $value = NULL, $objectId = NULL)
    {

        $property = strtolower($property);
        //1. Check that the property exists in $dataModel;
        if (!array_key_exists($property, $this->propertyModel))
            return false; //@TODO Raise error? specified column not found
        //2. Validate the Value?
        if (empty($value)):
            //Attempt to get the default value;
            if (isset($this->propertyModel[$property][3])) //the third item in the array should be the default value;
                $value = $this->propertyModel[$property][3];
        endif;
        //3. Store the value with the property name in $propertyData;
        if (empty($objectId) || (int)$objectId == $this->objectId):
            $this->propertyData[$property] = $value;
            //elseif(!empty($objectId)):
            //@TODO Go to the database set the property value for this object
        endif;

        return $this;
    }
694828
public function getValue()
    {
        $value = parent::getValue();
        return $value === null || $value === [] ? $this->getDefaultValue() : $value;
    }
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;
    }
765761
public  function getList( $key, array $default_value = NULL )
    {
        $value = $this->getPropertyNodeValue( $key );

        // return default value if the element is null
        if ( NULL === $value ){
            return NULL === $default_value ? NULL : new ArrayList($default_value);
        }

        return new ArrayList($value);
    }
902643
public function getDefaultValue()
    {
        if (!$this->hasDefaultValue()) {
            return null;
        }

        if ($this->defaultValue instanceof FragmentInterface) {
            //Defined as SQL piece
            return $this->defaultValue;
        }

        if (in_array($this->getAbstractType(), ['time', 'date', 'datetime', 'timestamp'])) {
            return $this->formatDatetime($this->getAbstractType(), $this->defaultValue);
        }

        switch ($this->getType()) {
            case 'int':
                return (int)$this->defaultValue;
            case 'float':
                return (float)$this->defaultValue;
            case 'bool':
                if (is_string($this->defaultValue) && strtolower($this->defaultValue) == 'false') {
                    return false;
                }

                return (bool)$this->defaultValue;
        }

        return (string)$this->defaultValue;
    }
814485
public static void getDefaultValues(Properties defaultValues) {
		defaultValues.put(NetworkConfig.SERIALIZER_CLASSNAME, DEFAULT_EVENT_SERIALIZER.getName());
		defaultValues.put(NetworkConfig.ENCRYPTER_CLASSNAME, DEFAULT_EVENT_ENCRYPTER.getName());
	}