private AbstractQValue getValue ( final Object _value ) throws EFapsException { AbstractQValue ret = null ; if ( _value == null ) { ret = new QNullValue ( ) ; } else if ( _value instanceof Number ) { ret = new QNumberValue ( ( Number ) _value ) ; } else if ( _value instanceof String ) { ret = new QStringValue ( ( String ) _value ) ; } else if ( _value instanceof DateTime ) { ret = new QDateTimeValue ( ( DateTime ) _value ) ; } else if ( _value instanceof Boolean ) { ret = new QBooleanValue ( ( Boolean ) _value ) ; } else if ( _value instanceof Status ) { ret = new QNumberValue ( ( ( Status ) _value ) . getId ( ) ) ; } else if ( _value instanceof CIStatus ) { ret = new QNumberValue ( Status . find ( ( CIStatus ) _value ) . getId ( ) ) ; } else if ( _value instanceof Instance ) { if ( ! ( ( Instance ) _value ) . isValid ( ) ) { QueryBuilder . LOG . error ( "the given Instance was not valid and cannot be used as filter criteria" , _value ) ; throw new EFapsException ( QueryBuilder . class , "invalid Instance given" ) ; } ret = new QNumberValue ( ( ( Instance ) _value ) . getId ( ) ) ; } else if ( _value instanceof UoM ) { ret = new QNumberValue ( ( ( UoM ) _value ) . getId ( ) ) ; } else if ( _value instanceof IBitEnum ) { ret = new QBitValue ( ( IBitEnum ) _value ) ; } else if ( _value instanceof IEnum ) { ret = new QNumberValue ( ( ( IEnum ) _value ) . getInt ( ) ) ; } else if ( _value instanceof AbstractQValue ) { ret = ( AbstractQValue ) _value ; } else { throw new EFapsException ( QueryBuilder . class , "notsuported" ) ; } return ret ; }
Get the QAbstractValue for a value .