public static void insertFromDevState(final DevState devStateValue,
	    final DeviceData deviceDataArgin, final int dataType) throws DevFailed {

	final Integer integerValue = Integer.valueOf(devStateValue.value());
	switch (deviceDataArgin.getType()) {
	case TangoConst.Tango_DEV_SHORT:
	    deviceDataArgin.insert(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_USHORT:
	    deviceDataArgin.insert_us(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_CHAR:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR",
		    "input type Tango_DEV_CHAR not supported",
		    "CommandHelper.insertFromDevState(DevState value,deviceDataArgin)");
	    break;
	case TangoConst.Tango_DEV_UCHAR:
	    deviceDataArgin.insert(integerValue.shortValue());
	    break;
	case TangoConst.Tango_DEV_LONG:
	    deviceDataArgin.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_ULONG:
	    deviceDataArgin.insert_ul(integerValue.longValue());
	    break;
	case TangoConst.Tango_DEV_LONG64:
	    deviceDataArgin.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_ULONG64:
	    deviceDataArgin.insert_u64(integerValue.longValue());
	    break;
	case TangoConst.Tango_DEV_INT:
	    deviceDataArgin.insert(integerValue.intValue());
	    break;
	case TangoConst.Tango_DEV_FLOAT:
	    deviceDataArgin.insert(integerValue.floatValue());
	    break;
	case TangoConst.Tango_DEV_DOUBLE:
	    deviceDataArgin.insert(integerValue.doubleValue());
	    break;
	case TangoConst.Tango_DEV_STRING:
	    deviceDataArgin.insert(integerValue.toString());
	    break;
	case TangoConst.Tango_DEV_BOOLEAN:
	    if (integerValue.doubleValue() == 1) {
		deviceDataArgin.insert(true);
	    } else {
		deviceDataArgin.insert(false);
	    }
	    break;
	case TangoConst.Tango_DEV_STATE:
	    deviceDataArgin.insert(devStateValue);
	    break;
	default:
	    Except.throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
		    + deviceDataArgin.getType() + " not supported",
		    "CommandHelper.insertFromDevState(DevState value,deviceDataArgin)");
	    break;
	}
    }
public static void insertFromDevState ( final DevState devStateValue , final DeviceData deviceDataArgin , final int dataType ) throws DevFailed { final Integer integerValue = Integer . valueOf ( devStateValue . value ( ) ) ; switch ( deviceDataArgin . getType ( ) ) { case TangoConst . Tango_DEV_SHORT : deviceDataArgin . insert ( integerValue . shortValue ( ) ) ; break ; case TangoConst . Tango_DEV_USHORT : deviceDataArgin . insert_us ( integerValue . shortValue ( ) ) ; break ; case TangoConst . Tango_DEV_CHAR : Except . throw_exception ( "TANGO_WRONG_DATA_ERROR" , "input type Tango_DEV_CHAR not supported" , "CommandHelper.insertFromDevState(DevState value,deviceDataArgin)" ) ; break ; case TangoConst . Tango_DEV_UCHAR : deviceDataArgin . insert ( integerValue . shortValue ( ) ) ; break ; case TangoConst . Tango_DEV_LONG : deviceDataArgin . insert ( integerValue . intValue ( ) ) ; break ; case TangoConst . Tango_DEV_ULONG : deviceDataArgin . insert_ul ( integerValue . longValue ( ) ) ; break ; case TangoConst . Tango_DEV_LONG64 : deviceDataArgin . insert ( integerValue . intValue ( ) ) ; break ; case TangoConst . Tango_DEV_ULONG64 : deviceDataArgin . insert_u64 ( integerValue . longValue ( ) ) ; break ; case TangoConst . Tango_DEV_INT : deviceDataArgin . insert ( integerValue . intValue ( ) ) ; break ; case TangoConst . Tango_DEV_FLOAT : deviceDataArgin . insert ( integerValue . floatValue ( ) ) ; break ; case TangoConst . Tango_DEV_DOUBLE : deviceDataArgin . insert ( integerValue . doubleValue ( ) ) ; break ; case TangoConst . Tango_DEV_STRING : deviceDataArgin . insert ( integerValue . toString ( ) ) ; break ; case TangoConst . Tango_DEV_BOOLEAN : if ( integerValue . doubleValue ( ) == 1 ) { deviceDataArgin . insert ( true ) ; } else { deviceDataArgin . insert ( false ) ; } break ; case TangoConst . Tango_DEV_STATE : deviceDataArgin . insert ( devStateValue ) ; break ; default : Except . throw_exception ( "TANGO_WRONG_DATA_ERROR" , "input type " + deviceDataArgin . getType ( ) + " not supported" , "CommandHelper.insertFromDevState(DevState value,deviceDataArgin)" ) ; break ; } }
Convert the value according the type of DeviceData.

@param devStateValue
the value to insert on DeviceData
@param deviceDataArgin
the DeviceData attribute to write
@param dataType
the type of inserted data
@throws DevFailed