This commit is contained in:
Timo Westkämper 2009-11-05 13:54:08 +00:00
parent 62618162b5
commit 3300cd2b60
2 changed files with 16 additions and 7 deletions

View File

@ -31,8 +31,8 @@ public class CascadingBoolean extends EBoolean{
}
return this;
}
public CascadingBoolean andAny(EBoolean... args) {
public CascadingBoolean andAnyOf(EBoolean... args) {
if (args.length > 0){
EBoolean any = args[0];
for (int i = 1; i < args.length; i++){
@ -57,7 +57,7 @@ public class CascadingBoolean extends EBoolean{
return this;
}
public CascadingBoolean orAll(EBoolean... args) {
public CascadingBoolean orAllOf(EBoolean... args) {
if (args.length > 0){
EBoolean all = args[0];
for (int i = 1; i < args.length; i++){

View File

@ -7,7 +7,6 @@ package com.mysema.query;
import org.junit.Test;
import com.mysema.query.alias.Alias;
import com.mysema.query.types.expr.EBoolean;
@ -19,10 +18,20 @@ import com.mysema.query.types.expr.EBoolean;
*/
public class CascadingBooleanTest {
private EBoolean first = EBoolean.TRUE;
private EBoolean second = EBoolean.FALSE;
@Test
public void test(){
EBoolean etrue = Alias.$(true);
EBoolean efalse = Alias.$(false);
new CascadingBoolean().and(etrue).or(efalse);
new CascadingBoolean().and(first).or(second);
}
@Test
public void advanced(){
CascadingBoolean builder = new CascadingBoolean();
builder.andAnyOf(first, second, first);
builder.orAllOf(first, second, first);
System.out.println(builder);
}
}