code: public IPrimitiveDatatype<?> getValueAsPrimitive() {
  		if (!(getValue() instanceof IPrimitiveDatatype)) {
  			throw new ClassCastException("Extension with URL["+myUrl+"] can not be cast to primitive type, type is: "+ getClass().getCanonicalName());
  		}
  		return (IPrimitiveDatatype<?>) getValue();
  	}
docs: Returns the value of this extension, casted to a primitive datatype. This is a convenience method which should only be called if you are sure that the value for this particular extension will
  be a primitive.
  <p>
  Note that if this extension contains extensions (instead of a datatype) then <b>this method will return null</b>. In that case, you must use {@link #getUndeclaredExtensions()} and
  {@link #getUndeclaredModifierExtensions()} to retrieve the child extensions.
  </p>
  
  @throws ClassCastException
  If the value of this extension is not a primitive datatype