DOFValueisCompatibleWith Method OpenDOF Object Access Library
Verify that a value is compatible with the specified DOFType .

Compatibility is less strict of a requirement that saying that the type of the value is equal to the given type. Instead, compatibility is verified by introspecting the value and the type, and checking whether or not they are compatible.

A simple example of this is a string value that has a length of 25 characters. The type associated with the value (as returned by getDOFType() ) may have a maximum length of 50 characters. The type passed to this routine may have a maximum length of 30 characters as indicated by DOFType.getMaxLength() . In this case the value would be compatible, even though the value's type is not compatible with the passed type as the maximum lengths are not compatible. It is the actual data length (25 characters) that matters for this routine.

The following must always succeed without an exception:

value.CompatibleWith( value.getDOFType() )
In other words, a value must always be compatible with its own type.

Namespace: org.opendof.core.oal
Assembly: dof-oal (in dof-oal.dll) Version: 7.0.1.2
Syntax

C#
void isCompatibleWith(
	DOFType type
)

Parameters

type
Type: org.opendof.core.oalDOFType
The type to compare against. The type must be reflected in order to determine equivalence, although equality of the argument with the type of the value ensures compatibility.
Exceptions

ExceptionCondition
DOFErrorExceptionThe value is not compatible.
DOFErrorException
See Also

Reference