public static void setOrAdd ( EObject owner , EReference reference , Object value ) { if ( value != null ) { if ( reference . isMany ( ) ) { @ SuppressWarnings ( "unchecked" ) Collection < EObject > values = ( Collection < EObject > ) owner . eGet ( reference , false ) ; if ( values != null && value instanceof EObject ) { values . add ( ( EObject ) value ) ; } } else { owner . eSet ( reference , value ) ; } } }
Set or add a value to an object reference . The value must be an EObject .