mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
moved Assert to com.mysema.util
This commit is contained in:
parent
d01c58a532
commit
31b2e683ec
@ -12,7 +12,7 @@ import org.codehaus.janino.ExpressionEvaluator;
|
||||
|
||||
import com.mysema.query.grammar.JavaOps;
|
||||
import com.mysema.query.grammar.types.Expr;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* JaninoEvaluator is a Janino compiler based Evaluator implementation
|
||||
|
||||
@ -29,7 +29,7 @@ import com.mysema.query.grammar.types.Path;
|
||||
import com.mysema.query.grammar.types.Expr.EConstant;
|
||||
import com.mysema.query.grammar.types.PathMetadata.PathType;
|
||||
import com.mysema.query.serialization.BaseSerializer;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -27,7 +27,7 @@ import com.mysema.query.collections.utils.QueryIteratorUtils;
|
||||
import com.mysema.query.grammar.JavaOps;
|
||||
import com.mysema.query.grammar.types.Expr;
|
||||
import com.mysema.query.grammar.types.Expr.EBoolean;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* FilteringMultiIterator extends the MultiIterator to provide a filtered view
|
||||
|
||||
@ -17,7 +17,7 @@ import com.mysema.query.collections.QueryIndexSupport;
|
||||
import com.mysema.query.grammar.JavaOps;
|
||||
import com.mysema.query.grammar.OrderSpecifier;
|
||||
import com.mysema.query.grammar.types.Expr;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* CustomQueryable a ColQuery like interface for querying on custom IteratorSource sources
|
||||
|
||||
@ -17,7 +17,7 @@ import com.mysema.query.grammar.types.Operation;
|
||||
import com.mysema.query.grammar.types.Path;
|
||||
import com.mysema.query.grammar.types.Expr.EBoolean;
|
||||
import com.mysema.query.grammar.types.Expr.EConstant;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* IndexCreationTask provides
|
||||
|
||||
@ -13,7 +13,7 @@ import com.mysema.query.collections.QueryIndexSupport;
|
||||
import com.mysema.query.grammar.JavaOps;
|
||||
import com.mysema.query.grammar.types.Expr;
|
||||
import com.mysema.query.grammar.types.Expr.EBoolean;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* SimpleIndexSupport is a minimal QueryIndexSupport implementation
|
||||
|
||||
@ -12,7 +12,7 @@ import java.util.Map;
|
||||
import com.mysema.query.collections.IteratorSource;
|
||||
import com.mysema.query.collections.QueryIndexSupport;
|
||||
import com.mysema.query.grammar.types.Expr;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* SimpleIteratorSource is the default implementation of the IndexSupport interface
|
||||
|
||||
@ -11,7 +11,7 @@ import com.mysema.query.collections.eval.Evaluator;
|
||||
import com.mysema.query.collections.eval.JaninoEvaluator;
|
||||
import com.mysema.query.grammar.JavaOps;
|
||||
import com.mysema.query.grammar.types.Expr;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* EvaluatorUtils provides factory methods for Evaluator creation
|
||||
|
||||
@ -8,7 +8,7 @@ package com.mysema.query;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
|
||||
import com.mysema.query.grammar.types.Expr;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* JoinExpression is a join element in a Query instance
|
||||
|
||||
@ -9,7 +9,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.mysema.query.grammar.types.Expr;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* ProjectableAdapter is an adapter implementation for the Projectable
|
||||
|
||||
@ -8,7 +8,7 @@ package com.mysema.query;
|
||||
import com.mysema.query.grammar.OrderSpecifier;
|
||||
import com.mysema.query.grammar.types.Expr;
|
||||
import com.mysema.query.grammar.types.Expr.EBoolean;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* QueryAdapter is an adapter implementation for Query instace wrapping
|
||||
|
||||
@ -17,7 +17,7 @@ import com.mysema.query.grammar.types.Expr.EString;
|
||||
import com.mysema.query.grammar.types.Operation.OBoolean;
|
||||
import com.mysema.query.grammar.types.Path.PEntity;
|
||||
import com.mysema.query.grammar.types.Path.PEntityCollection;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* Grammar provides the factory methods for the fluent grammar.
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
package com.mysema.query.grammar;
|
||||
|
||||
import com.mysema.query.grammar.types.Expr;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* OrderSpecifier represents an order by element in a Query instance
|
||||
|
||||
@ -19,7 +19,7 @@ import com.mysema.query.grammar.types.Operation.OComparable;
|
||||
import com.mysema.query.grammar.types.Operation.ONumber;
|
||||
import com.mysema.query.grammar.types.Operation.OString;
|
||||
import com.mysema.query.grammar.types.Operation.OStringArray;
|
||||
import com.mysema.query.util.Assert;
|
||||
import com.mysema.util.Assert;
|
||||
|
||||
/**
|
||||
* Factory provides factory methods for various needs
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
package com.mysema.query.util;
|
||||
package com.mysema.util;
|
||||
|
||||
/**
|
||||
* Assert provides
|
||||
@ -19,12 +19,21 @@ public class Assert {
|
||||
}
|
||||
|
||||
public static <T> T notNull(T object) {
|
||||
if (object == null) throw new IllegalArgumentException("was null");
|
||||
return object;
|
||||
return notNull(object, "was null");
|
||||
}
|
||||
|
||||
public static <T> T notNull(T object, String message) {
|
||||
if (object == null) throw new IllegalArgumentException(message);
|
||||
return object;
|
||||
}
|
||||
|
||||
public static String notEmpty(String contentType) {
|
||||
return hasText(contentType);
|
||||
}
|
||||
|
||||
public static <T> T[] notEmpty(T[] objects) {
|
||||
if(objects == null || objects.length == 0) throw new IllegalArgumentException("was empty");
|
||||
return objects;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user