public static < T > T trueOrFalse ( final T trueCase , final T falseCase , final boolean ... flags ) { boolean interlink = true ; if ( flags != null && 0 < flags . length ) { interlink = false ; } for ( int i = 0 ; i < flags . length ; i ++ ) { if ( i == 0 ) { interlink = ! flags [ i ] ; continue ; } interlink &= ! flags [ i ] ; } if ( interlink ) { return falseCase ; } return trueCase ; }
Decides over the given flags if the true - case or the false - case will be return .