# How to cast com.inductiveautomation.opcua.types.DataValue?

**URL:** <https://forum.inductiveautomation.com/t/how-to-cast-com-inductiveautomation-opcua-types-datavalue/18838>\
**Category:** Module Development\
**Created:** [July 16, 2018, 3:05pm UTC](https://forum.inductiveautomation.com/t/how-to-cast-com-inductiveautomation-opcua-types-datavalue/18838 "2018-07-16T15:05:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [July 16, 2018, 3:05pm UTC](https://forum.inductiveautomation.com/t/how-to-cast-com-inductiveautomation-opcua-types-datavalue/18838/1 "2018-07-16T15:05:10Z")

</div>

I would like to convert some value from **com.inductiveautomation.opcua.types.DataValue** type  
to Java class.  
When I try to cast the value, the following exception is triggered :

```auto
java.lang.ClassCastException: com.inductiveautomation.opcua.types.UInt64 cannot be cast to java.lang.Integer
```

Is there some utils functions in the sdk to achieve this ?
