public AndCondition optimize ( ) { AndCondition result = new AndCondition ( ) ; for ( Condition each : conditions ) { if ( Condition . class . equals ( each . getClass ( ) ) ) { result . getConditions ( ) . add ( each ) ; } } if ( result . getConditions ( ) . isEmpty ( ) ) { result . getConditions ( ) . add ( new NullCondition ( ) ) ; } return result ; }
Optimize and condition .