public static String extractToString ( final DeviceAttribute deviceAttributeRead ) throws DevFailed { final Object value = AttributeHelper . extract ( deviceAttributeRead ) ; String argout = null ; if ( value instanceof Short ) { argout = ( ( Short ) value ) . toString ( ) ; } else if ( value instanceof String ) { argout = ( String ) value ; } else if ( value instanceof Integer ) { argout = ( ( Integer ) value ) . toString ( ) ; } else if ( value instanceof Long ) { argout = ( ( Long ) value ) . toString ( ) ; } else if ( value instanceof Float ) { argout = ( ( Float ) value ) . toString ( ) ; } else if ( value instanceof Boolean ) { argout = ( ( Boolean ) value ) . toString ( ) ; } else if ( value instanceof Double ) { argout = ( ( Double ) value ) . toString ( ) ; } else if ( value instanceof DevState ) { argout = StateUtilities . getNameForState ( ( DevState ) value ) ; } else { Except . throw_exception ( "TANGO_WRONG_DATA_ERROR" , "output type " + value . getClass ( ) + " not supported" , "AttributeHelper.extractToString(Object value,deviceAttributeWritten)" ) ; } return argout ; }
Extract data from DeviceAttribute to a String