moved Assert to com.mysema.util

This commit is contained in:
Timo Westkämper 2009-04-23 14:56:12 +00:00
parent d01c58a532
commit 31b2e683ec
15 changed files with 26 additions and 17 deletions

View File

@ -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

View File

@ -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;
/**

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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;
}
}