Allows casting a input Object to a certain ValueType. Only works if the input Object is actually storing a instance of ValueType.