You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metamodel.apache.org by ka...@apache.org on 2013/07/19 11:33:11 UTC

[28/61] [partial] Hard rename of all 'org/eobjects' folders to 'org/apache'.

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/ImmutableRef.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/ImmutableRef.java b/core/src/main/java/org/eobjects/metamodel/util/ImmutableRef.java
deleted file mode 100644
index 0e74dc4..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/ImmutableRef.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-/**
- * Simple/hard implementation of the {@link Ref} interface.
- * 
- * @author Kasper Sørensen
- * 
- * @param <E>
- */
-public final class ImmutableRef<E> implements Ref<E> {
-
-	private final E _object;
-
-	public ImmutableRef(E object) {
-		_object = object;
-	}
-
-	@Override
-	public E get() {
-		return _object;
-	}
-
-	public static <E> Ref<E> of(E object) {
-		return new ImmutableRef<E>(object);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/InMemoryResource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/InMemoryResource.java b/core/src/main/java/org/eobjects/metamodel/util/InMemoryResource.java
deleted file mode 100644
index 808d4b0..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/InMemoryResource.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Serializable;
-
-/**
- * An entirely in-memory kept {@link Resource}.
- */
-public class InMemoryResource implements Resource, Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private final String _path;
-    private byte[] _contents;
-    private long _lastModified;
-
-    /**
-     * Constructs a new {@link InMemoryResource} with a path/name
-     * 
-     * @param path
-     */
-    public InMemoryResource(String path) {
-        this(path, new byte[0], -1);
-    }
-
-    /**
-     * Constructs a new {@link InMemoryResource} with a path/name and some
-     * initial contents.
-     * 
-     * @param path
-     * @param contents
-     * @param lastModified
-     */
-    public InMemoryResource(String path, byte[] contents, long lastModified) {
-        _path = path;
-        _contents = contents;
-        _lastModified = lastModified;
-    }
-    
-    @Override
-    public String toString() {
-        return "InMemoryResource[" + _path + "]";
-    }
-
-    @Override
-    public String getName() {
-        String name = _path;
-        final int lastSlash = name.lastIndexOf('/');
-        final int lastBackSlash = name.lastIndexOf('\\');
-        final int lastIndex = Math.max(lastSlash, lastBackSlash);
-        if (lastIndex != -1) {
-            final String lastPart = name.substring(lastIndex + 1);
-            if (!"".equals(lastPart)) {
-                return lastPart;
-            }
-        }
-        return name;
-    }
-
-    /**
-     * Gets the path of this resource
-     * 
-     * @return
-     */
-    public String getPath() {
-        return _path;
-    }
-
-    @Override
-    public boolean isReadOnly() {
-        return false;
-    }
-
-    @Override
-    public boolean isExists() {
-        return true;
-    }
-
-    @Override
-    public long getSize() {
-        return _contents.length;
-    }
-
-    @Override
-    public long getLastModified() {
-        return _lastModified;
-    }
-
-    @Override
-    public void write(Action<OutputStream> writeCallback) throws ResourceException {
-        try {
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            writeCallback.run(baos);
-            _contents = baos.toByteArray();
-            _lastModified = System.currentTimeMillis();
-        } catch (Exception e) {
-            throw new ResourceException(this, e);
-        }
-    }
-
-    @Override
-    public void append(Action<OutputStream> appendCallback) throws ResourceException {
-        try {
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            baos.write(_contents);
-            appendCallback.run(baos);
-            _contents = baos.toByteArray();
-            _lastModified = System.currentTimeMillis();
-        } catch (Exception e) {
-            throw new ResourceException(this, e);
-        }
-    }
-
-    @Override
-    public InputStream read() throws ResourceException {
-        return new ByteArrayInputStream(_contents);
-    }
-
-    @Override
-    public void read(Action<InputStream> readCallback) throws ResourceException {
-        final InputStream inputStream = read();
-        try {
-            readCallback.run(inputStream);
-        } catch (Exception e) {
-            throw new ResourceException(this, e);
-        }
-    }
-
-    @Override
-    public <E> E read(Func<InputStream, E> readCallback) throws ResourceException {
-        final InputStream inputStream = read();
-        try {
-            return readCallback.eval(inputStream);
-        } catch (Exception e) {
-            throw new ResourceException(this, e);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/InclusionPredicate.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/InclusionPredicate.java b/core/src/main/java/org/eobjects/metamodel/util/InclusionPredicate.java
deleted file mode 100644
index 03bc689..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/InclusionPredicate.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * A predicate that uses an inclusion list ("white list") of elements to
- * determine whether to evaluate true or false.
- * 
- * @param <E>
- */
-public class InclusionPredicate<E> implements Predicate<E> {
-
-    private final Collection<E> _inclusionList;
-
-    public InclusionPredicate(Collection<E> inclusionList) {
-        _inclusionList = inclusionList;
-    }
-
-    @Override
-    public Boolean eval(E arg) {
-        if (_inclusionList.contains(arg)) {
-            return true;
-        }
-        return false;
-    }
-    
-    public Collection<E> getInclusionList() {
-        return Collections.unmodifiableCollection(_inclusionList);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/LazyRef.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/LazyRef.java b/core/src/main/java/org/eobjects/metamodel/util/LazyRef.java
deleted file mode 100644
index b916a90..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/LazyRef.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Represents a lazy loaded reference.
- * 
- * @author Kasper Sørensen
- * 
- * @param <E>
- */
-public abstract class LazyRef<E> implements Ref<E> {
-
-    private static final Logger logger = LoggerFactory.getLogger(LazyRef.class);
-
-    private final AtomicBoolean _fetched = new AtomicBoolean(false);
-    private volatile Throwable _error;
-    private E _object;
-
-    @Override
-    public final E get() {
-        if (!_fetched.get()) {
-            synchronized (_fetched) {
-                if (!_fetched.get()) {
-                    try {
-                        _object = fetch();
-                    } catch (Throwable t) {
-                        _error = t;
-                        if (t instanceof RuntimeException) {
-                            throw (RuntimeException) t;
-                        }
-                        logger.warn("Failed to fetch value: " + this + ". Reporting error.", t);
-                    } finally {
-                        _fetched.set(true);
-                    }
-                }
-            }
-        }
-        return _object;
-    }
-
-    protected abstract E fetch() throws Throwable;
-
-    /**
-     * Gets whether the lazy loaded reference has been loaded or not.
-     * 
-     * @return a boolean indicating whether or not the reference has been loaded
-     *         or not
-     */
-    public boolean isFetched() {
-        return _fetched.get();
-    }
-
-    /**
-     * Gets any error that occurred while fetching the lazy loaded value.
-     * 
-     * @return
-     */
-    public Throwable getError() {
-        return _error;
-    }
-
-    /**
-     * Requests an asynchronous load of the lazy reference. If not already
-     * loaded, this will cause another thread to load the reference, typically
-     * to make it immediately available for later evaluation.
-     * 
-     * @param errorAction
-     *            an optional error action to invoke if an exception is thrown
-     *            during loading of the reference.
-     */
-    public void requestLoad(final Action<Throwable> errorAction) {
-        if (!isFetched()) {
-            ExecutorService executorService = SharedExecutorService.get();
-            executorService.submit(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        get();
-                    } catch (RuntimeException e) {
-                        // do nothing, the exception will be handled via _error
-                        // below
-                    }
-                    if (_error != null && errorAction != null) {
-                        try {
-                            errorAction.run(_error);
-                        } catch (Exception e) {
-                            logger.error("Error handling action failed!", e);
-                        }
-                    }
-                }
-            });
-        }
-    }
-
-    /**
-     * Requests an asynchronous load of the lazy reference. If not already
-     * loaded, this will cause another thread to load the reference, typically
-     * to make it immediately available for later evaluation.
-     */
-    public void requestLoad() {
-        requestLoad(null);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/Month.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/Month.java b/core/src/main/java/org/eobjects/metamodel/util/Month.java
deleted file mode 100644
index 3380e5f..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/Month.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.util.Calendar;
-
-/**
- * Provides a handy and type-safe enum around the months otherwise defined as
- * int constants in java.util.Calendar.
- * 
- * @author Kasper Sørensen
- * 
- */
-public enum Month implements HasName {
-
-    JANUARY(Calendar.JANUARY),
-
-    FEBRUARY(Calendar.FEBRUARY),
-
-    MARCH(Calendar.MARCH),
-
-    APRIL(Calendar.APRIL),
-
-    MAY(Calendar.MAY),
-
-    JUNE(Calendar.JUNE),
-
-    JULY(Calendar.JULY),
-
-    AUGUST(Calendar.AUGUST),
-
-    SEPTEMBER(Calendar.SEPTEMBER),
-
-    OCTOBER(Calendar.OCTOBER),
-
-    NOVEMBER(Calendar.NOVEMBER),
-
-    DECEMBER(Calendar.DECEMBER);
-
-    private int calendarConstant;
-
-    private Month(int calendarConstant) {
-        this.calendarConstant = calendarConstant;
-    }
-
-    public int getCalendarConstant() {
-        return calendarConstant;
-    }
-
-    public static Month getByCalendarConstant(int calendarConstant) {
-        for (Month month : values()) {
-            if (month.getCalendarConstant() == calendarConstant) {
-                return month;
-            }
-        }
-        return null;
-    }
-
-    public Month next() {
-        if (this == DECEMBER) {
-            return JANUARY;
-        }
-        return values()[ordinal() + 1];
-    }
-
-    public Month previous() {
-        if (this == JANUARY) {
-            return DECEMBER;
-        }
-        return values()[ordinal() - 1];
-    }
-
-    @Override
-    public String getName() {
-        final String capitalized = toString();
-        return capitalized.charAt(0) + capitalized.substring(1).toLowerCase();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/MutableRef.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/MutableRef.java b/core/src/main/java/org/eobjects/metamodel/util/MutableRef.java
deleted file mode 100644
index 3b6175b..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/MutableRef.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-/**
- * Represents a mutable reference to any object
- * 
- * @author Kasper Sørensen
- * 
- * @param <E>
- */
-public final class MutableRef<E> implements Ref<E> {
-
-	private E _object;
-
-	public MutableRef() {
-	}
-
-	public MutableRef(E object) {
-		_object = object;
-	}
-
-	@Override
-	public E get() {
-		return _object;
-	}
-
-	public void set(E object) {
-		_object = object;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/NumberComparator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/NumberComparator.java b/core/src/main/java/org/eobjects/metamodel/util/NumberComparator.java
deleted file mode 100644
index 5a1ba02..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/NumberComparator.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.util.Comparator;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Comparator that can compare numbers of various kinds (short, integer, float,
- * double etc)
- */
-public final class NumberComparator implements Comparator<Object> {
-
-	private static final Logger logger = LoggerFactory
-			.getLogger(NumberComparator.class);
-
-	private static final Comparator<Object> _instance = new NumberComparator();
-
-	public static Comparator<Object> getComparator() {
-		return _instance;
-	}
-
-	private NumberComparator() {
-	}
-
-	public static Comparable<Object> getComparable(Object o) {
-		final Number n = toNumber(o);
-		return new Comparable<Object>() {
-
-			@Override
-			public boolean equals(Object obj) {
-				return _instance.equals(obj);
-			}
-
-			public int compareTo(Object o) {
-				return _instance.compare(n, o);
-			}
-
-			@Override
-			public String toString() {
-				return "NumberComparable[number=" + n + "]";
-			}
-
-		};
-	}
-
-	public int compare(Object o1, Object o2) {
-		if (o1 == null && o2 == null) {
-			return 0;
-		}
-		if (o1 == null) {
-			return -1;
-		}
-		if (o2 == null) {
-			return 1;
-		}
-		Number n1 = toNumber(o1);
-		Number n2 = toNumber(o2);
-		return Double.valueOf(n1.doubleValue()).compareTo(n2.doubleValue());
-	}
-
-	public static Number toNumber(Object value) {
-		if (value == null) {
-			return null;
-		} else if (value instanceof Number) {
-			return (Number) value;
-		} else if (value instanceof Boolean) {
-			if (Boolean.TRUE.equals(value)) {
-				return 1;
-			} else {
-				return 0;
-			}
-		} else {
-			String stringValue = value.toString();
-			try {
-				return Integer.parseInt(stringValue);
-			} catch (NumberFormatException e1) {
-				try {
-					return Double.parseDouble(stringValue);
-				} catch (NumberFormatException e2) {
-					logger.warn(
-							"Could not convert '{}' to number, returning null",
-							value);
-					return null;
-				}
-			}
-		}
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/ObjectComparator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/ObjectComparator.java b/core/src/main/java/org/eobjects/metamodel/util/ObjectComparator.java
deleted file mode 100644
index 9b15452..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/ObjectComparator.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.util.Comparator;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * General purpose comparator to use for objects of various kinds. Prevents
- * NullPointerExceptions and tries to use comparable interface if available and
- * appropriate on incoming objects.
- */
-public final class ObjectComparator implements Comparator<Object> {
-
-	private static final Logger logger = LoggerFactory
-			.getLogger(ObjectComparator.class);
-
-	private static final Comparator<Object> _instance = new ObjectComparator();
-
-	public static Comparator<Object> getComparator() {
-		return _instance;
-	}
-
-	private ObjectComparator() {
-	}
-
-	public static Comparable<Object> getComparable(final Object o) {
-		return new Comparable<Object>() {
-
-			@Override
-			public boolean equals(Object obj) {
-				return _instance.equals(obj);
-			}
-
-			public int compareTo(Object o2) {
-				return _instance.compare(o, o2);
-			}
-
-			@Override
-			public String toString() {
-				return "ObjectComparable[object=" + o + "]";
-			}
-		};
-	}
-
-	@SuppressWarnings("unchecked")
-	public int compare(final Object o1, final Object o2) {
-		logger.debug("compare({},{})", o1, o2);
-		if (o1 == null && o2 == null) {
-			return 0;
-		}
-		if (o1 == null) {
-			return -1;
-		}
-		if (o2 == null) {
-			return 1;
-		}
-		if (o1 instanceof Number && o1 instanceof Number) {
-			return NumberComparator.getComparator().compare(o1, o2);
-		}
-		if (TimeComparator.isTimeBased(o1) && TimeComparator.isTimeBased(o2)) {
-			return TimeComparator.getComparator().compare(o1, o2);
-		}
-		if (BooleanComparator.isBoolean(o1) && BooleanComparator.isBoolean(o2)) {
-			return BooleanComparator.getComparator().compare(o1, o2);
-		}
-		if (o1 instanceof Comparable && o2 instanceof Comparable) {
-			@SuppressWarnings("rawtypes")
-			Comparable c1 = (Comparable) o1;
-			@SuppressWarnings("rawtypes")
-			Comparable c2 = (Comparable) o2;
-			// We can only count on using the comparable interface if o1 and o2
-			// are within of the same class or if one is a subclass of the other
-			if (c1.getClass().isAssignableFrom(c2.getClass())) {
-				return c1.compareTo(o2);
-			}
-			if (o2.getClass().isAssignableFrom(c1.getClass())) {
-				return -1 * c2.compareTo(o1);
-			}
-		}
-		logger.info("Using ToStringComparator because no apparent better comparison method could be found");
-		return ToStringComparator.getComparator().compare(o1, o2);
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/Predicate.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/Predicate.java b/core/src/main/java/org/eobjects/metamodel/util/Predicate.java
deleted file mode 100644
index 4268c66..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/Predicate.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-/**
- * A predicate is a special type of {@link Func}, used typically for
- * inclusion/exclusion criteria.
- * 
- * @author Kasper Sørensen
- * 
- * @param <E>
- */
-public interface Predicate<E> extends Func<E, Boolean> {
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/Ref.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/Ref.java b/core/src/main/java/org/eobjects/metamodel/util/Ref.java
deleted file mode 100644
index 79fc36d..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/Ref.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-/**
- * Represents an abstract reference. This interface enables use of both regular,
- * hard references, soft references and deferred/lazy references.
- * 
- * @author Kasper Sørensen
- * 
- * @param <E>
- */
-public interface Ref<E> {
-
-	public E get();
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/Resource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/Resource.java b/core/src/main/java/org/eobjects/metamodel/util/Resource.java
deleted file mode 100644
index b7a4493..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/Resource.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * Represents a resource from which we can read and write bytes
- */
-public interface Resource extends HasName {
-
-    /**
-     * Gets the name of the resource, typically a filename or other identifying
-     * string
-     */
-    @Override
-    public String getName();
-
-    /**
-     * Determines if the file is read only, or if writes are also possible.
-     * 
-     * @return
-     */
-    public boolean isReadOnly();
-
-    /**
-     * Determines if the resource referenced by this object exists or not.
-     * 
-     * @return
-     */
-    public boolean isExists();
-
-    /**
-     * Gets the size (in number of bytes) of this resource's data. An
-     * approximated number is allowed.
-     * 
-     * If the size is not determinable without actually reading through the
-     * whole contents of the resource, -1 is returned.
-     * 
-     * @return
-     */
-    public long getSize();
-
-    /**
-     * Gets the last modified timestamp value (measured in milliseconds since
-     * the epoch (00:00:00 GMT, January 1, 1970)) of the resource, if available.
-     * If the last modified date is not available, -1 is returned.
-     * 
-     * @return
-     */
-    public long getLastModified();
-
-    /**
-     * Opens up an {@link OutputStream} to write to the resource, and allows a
-     * callback to perform writing actions on it.
-     * 
-     * @param writeCallback
-     *            a callback which should define what to write to the resource.
-     * 
-     * @throws ResourceException
-     *             if an error occurs while writing
-     */
-    public void write(Action<OutputStream> writeCallback) throws ResourceException;
-
-    /**
-     * Opens up an {@link InputStream} to append (write at the end of the
-     * existing stream) to the resource.
-     * 
-     * @param appendCallback
-     *            a callback which should define what to append to the resource.
-     * @throws ResourceException
-     *             if an error occurs while appending
-     */
-    public void append(Action<OutputStream> appendCallback) throws ResourceException;
-
-    /**
-     * Opens up an {@link InputStream} to read from the resource. Consumers of
-     * this method are expected to invoke the {@link InputStream#close()} method
-     * manually.
-     * 
-     * If possible, the other read(...) methods are preferred over this one,
-     * since they guarantee proper closing of the resource's handles.
-     * 
-     * @return
-     * @throws ResourceException
-     */
-    public InputStream read() throws ResourceException;
-
-    /**
-     * Opens up an {@link InputStream} to read from the resource, and allows a
-     * callback to perform writing actions on it.
-     * 
-     * @param readCallback
-     * 
-     * @throws ResourceException
-     *             if an error occurs while reading
-     */
-    public void read(Action<InputStream> readCallback) throws ResourceException;
-
-    /**
-     * Opens up an {@link InputStream} to read from the resource, and allows a
-     * callback function to perform writing actions on it and return the
-     * function's result.
-     * 
-     * @param readCallback
-     * @return the result of the function
-     * 
-     * @throws ResourceException
-     *             if an error occurs while reading
-     */
-    public <E> E read(Func<InputStream, E> readCallback) throws ResourceException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/ResourceException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/ResourceException.java b/core/src/main/java/org/eobjects/metamodel/util/ResourceException.java
deleted file mode 100644
index 2cca99b..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/ResourceException.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import org.eobjects.metamodel.MetaModelException;
-
-/**
- * Exception type for errors that occur while dealing with {@link Resource}s.
- */
-public class ResourceException extends MetaModelException {
-
-    private static final long serialVersionUID = 1L;
-    
-    private final Resource _resource;
-
-    public ResourceException(Resource resource, Exception cause) {
-        super(cause);
-        _resource = resource;
-    }
-
-    public ResourceException(Resource resource,String message, Exception cause) {
-        super(message, cause);
-        _resource = resource;
-    }
-
-    public ResourceException(Resource resource,String message) {
-        super(message);
-        _resource = resource;
-    }
-    
-    public Resource getResource() {
-        return _resource;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/SerializableRef.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/SerializableRef.java b/core/src/main/java/org/eobjects/metamodel/util/SerializableRef.java
deleted file mode 100644
index fac401e..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/SerializableRef.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.io.Serializable;
-
-/**
- * A serializable reference to an object which may or may not be serializable.
- * Using this reference there is safety that if the object IS serializable, it
- * will be serialized, or otherwise it will be gracefully ignored.
- * 
- * @param <E>
- */
-public final class SerializableRef<E> implements Ref<E>, Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private final E _serializableObj;
-    private final transient E _transientObj;
-
-    public SerializableRef(E obj) {
-        if (obj instanceof Serializable) {
-            _serializableObj = obj;
-            _transientObj = null;
-        } else {
-            _serializableObj = null;
-            _transientObj = obj;
-        }
-    }
-
-    @Override
-    public E get() {
-        if (_serializableObj == null) {
-            return _transientObj;
-        }
-        return _serializableObj;
-    }
-    
-    public boolean isSerializing() {
-        return _serializableObj != null;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((_serializableObj == null) ? 0 : _serializableObj.hashCode());
-        result = prime * result + ((_transientObj == null) ? 0 : _transientObj.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        SerializableRef<?> other = (SerializableRef<?>) obj;
-        if (_serializableObj == null) {
-            if (other._serializableObj != null)
-                return false;
-        } else if (!_serializableObj.equals(other._serializableObj))
-            return false;
-        if (_transientObj == null) {
-            if (other._transientObj != null)
-                return false;
-        } else if (!_transientObj.equals(other._transientObj))
-            return false;
-        return true;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/SharedExecutorService.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/SharedExecutorService.java b/core/src/main/java/org/eobjects/metamodel/util/SharedExecutorService.java
deleted file mode 100644
index e8f4e40..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/SharedExecutorService.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * A shared {@link ExecutorService} for use on ad-hoc tasks that can be
- * optimized by running operations in parallel.
- * 
- * Note that since this {@link ExecutorService} is shared, it is not recommended
- * to use it for dedicated tasks or daemon-like long-running tasks.
- * 
- * @author Kasper Sørensen
- */
-public final class SharedExecutorService {
-
-	/**
-	 * A custom thread factory that creates daemon threads.
-	 */
-	private static final class ThreadFactoryImpl implements ThreadFactory {
-
-		private static final AtomicInteger counter = new AtomicInteger(0);
-
-		private final ThreadGroup _threadGroup;
-
-		public ThreadFactoryImpl() {
-			SecurityManager s = System.getSecurityManager();
-			_threadGroup = (s != null) ? s.getThreadGroup() : Thread
-					.currentThread().getThreadGroup();
-		}
-
-		@Override
-		public Thread newThread(Runnable r) {
-			Thread thread = new Thread(_threadGroup, r,
-					"MetaModel.SharedExecutorService.Thread."
-							+ counter.incrementAndGet());
-			thread.setDaemon(true);
-			thread.setPriority(Thread.NORM_PRIORITY);
-			return thread;
-		}
-	}
-
-	private static final ExecutorService executor = Executors
-			.newCachedThreadPool(new ThreadFactoryImpl());
-
-	private SharedExecutorService() {
-		// prevent instantiation
-	}
-
-	/**
-	 * Gets the shared {@link ExecutorService}.
-	 * 
-	 * @return an {@link ExecutorService} for shared usage.
-	 */
-	public static final ExecutorService get() {
-		return executor;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/SimpleTableDef.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/SimpleTableDef.java b/core/src/main/java/org/eobjects/metamodel/util/SimpleTableDef.java
deleted file mode 100644
index 1739e95..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/SimpleTableDef.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.io.Serializable;
-import java.util.Arrays;
-
-import org.eobjects.metamodel.DataContext;
-import org.eobjects.metamodel.schema.Column;
-import org.eobjects.metamodel.schema.ColumnType;
-import org.eobjects.metamodel.schema.MutableColumn;
-import org.eobjects.metamodel.schema.MutableTable;
-import org.eobjects.metamodel.schema.Table;
-import org.eobjects.metamodel.schema.TableType;
-
-/**
- * Represents a table definition to be used in scenarios where a
- * {@link DataContext} is unable to detect/discover the table structure and
- * needs some basic input around expected table structures.
- * 
- * @author Kasper Sørensen
- */
-public class SimpleTableDef implements Serializable, HasName {
-
-    private static final long serialVersionUID = 1L;
-
-    private final String _name;
-    private final String[] _columnNames;
-    private final ColumnType[] _columnTypes;
-
-    /**
-     * Constructs a {@link SimpleTableDef} using a {@link Table} as a prototype.
-     * 
-     * @param table
-     */
-    public SimpleTableDef(Table table) {
-        _name = table.getName();
-        _columnNames = new String[table.getColumnCount()];
-        _columnTypes = new ColumnType[table.getColumnCount()];
-        for (int i = 0; i < table.getColumnCount(); i++) {
-            Column column = table.getColumn(i);
-            _columnNames[i] = column.getName();
-            _columnTypes[i] = column.getType();
-        }
-    }
-
-    /**
-     * Constructs a {@link SimpleTableDef}.
-     * 
-     * @param name
-     *            the name of the table
-     * @param columnNames
-     *            the names of the columns to include in the table
-     */
-    public SimpleTableDef(String name, String[] columnNames) {
-        this(name, columnNames, null);
-    }
-
-    /**
-     * Constructs a {@link SimpleTableDef}.
-     * 
-     * @param name
-     *            the name of table
-     * @param columnNames
-     *            the names of the columns to include in the table
-     * @param columnTypes
-     *            the column types of the columns specified.
-     */
-    public SimpleTableDef(String name, String[] columnNames, ColumnType[] columnTypes) {
-        _name = name;
-        _columnNames = columnNames;
-        if (columnTypes == null) {
-            columnTypes = new ColumnType[columnNames.length];
-            for (int i = 0; i < columnTypes.length; i++) {
-                columnTypes[i] = ColumnType.VARCHAR;
-            }
-        } else {
-            if (columnNames.length != columnTypes.length) {
-                throw new IllegalArgumentException(
-                        "Property names and column types cannot have different lengths (found " + columnNames.length
-                                + " and " + columnTypes.length + ")");
-            }
-        }
-        _columnTypes = columnTypes;
-    }
-
-    /**
-     * Gets the name of the table
-     * 
-     * @return the name of the table
-     */
-    public String getName() {
-        return _name;
-    }
-
-    /**
-     * Gets the names of the columns in the table
-     * 
-     * @return the names of the columns in the table
-     */
-    public String[] getColumnNames() {
-        return _columnNames;
-    }
-
-    /**
-     * Gets the types of the columns in the table
-     * 
-     * @return the types of the columns in the table
-     */
-    public ColumnType[] getColumnTypes() {
-        return _columnTypes;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((_name == null) ? 0 : _name.hashCode());
-        result = prime * result + Arrays.hashCode(_columnTypes);
-        result = prime * result + Arrays.hashCode(_columnNames);
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        SimpleTableDef other = (SimpleTableDef) obj;
-        if (_name == null) {
-            if (other._name != null)
-                return false;
-        } else if (!_name.equals(other._name))
-            return false;
-        if (!Arrays.equals(_columnTypes, other._columnTypes))
-            return false;
-        if (!Arrays.equals(_columnNames, other._columnNames))
-            return false;
-        return true;
-    }
-
-    @Override
-    public String toString() {
-        return "SimpleDbTableDef[name=" + _name + ",columnNames=" + Arrays.toString(_columnNames) + ",columnTypes="
-                + Arrays.toString(_columnTypes) + "]";
-    }
-
-    /**
-     * Creates a {@link MutableTable} based on this {@link SimpleTableDef}. Note
-     * that the created table will not have any schema set.
-     * 
-     * @return a table representation of this table definition.
-     */
-    public MutableTable toTable() {
-        String name = getName();
-        String[] columnNames = getColumnNames();
-        ColumnType[] columnTypes = getColumnTypes();
-
-        MutableTable table = new MutableTable(name, TableType.TABLE);
-
-        for (int i = 0; i < columnNames.length; i++) {
-            table.addColumn(new MutableColumn(columnNames[i], columnTypes[i], table, i, true));
-        }
-        return table;
-    }
-
-    /**
-     * Gets the index of a column name, or -1 if the column name does not exist
-     * 
-     * @param columnName
-     * @return
-     */
-    public int indexOf(String columnName) {
-        if (columnName == null) {
-            throw new IllegalArgumentException("Column name cannot be null");
-        }
-        for (int i = 0; i < _columnNames.length; i++) {
-            if (columnName.equals(_columnNames[i])) {
-                return i;
-            }
-        }
-        return -1;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/TimeComparator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/TimeComparator.java b/core/src/main/java/org/eobjects/metamodel/util/TimeComparator.java
deleted file mode 100644
index 5601deb..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/TimeComparator.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.text.DateFormat;
-import java.text.DateFormatSymbols;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.Locale;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Compares dates of various formats. Since this class has unchecked generic
- * conversion it can compare java.util.Date, java.sql.Date, java.sql.Time,
- * java.util.Calendar, Date-formatted strings etc.
- */
-public final class TimeComparator implements Comparator<Object> {
-
-    private static final Logger logger = LoggerFactory.getLogger(TimeComparator.class);
-
-    private static final String[] prototypePatterns = { "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd HH:mm:ss",
-            "yyyy-MM-dd HH:mm", "HH:mm:ss.SSS", "yyyy-MM-dd", "dd-MM-yyyy", "yy-MM-dd", "MM-dd-yyyy", "HH:mm:ss",
-            "HH:mm" };
-
-    private static final Comparator<Object> _instance = new TimeComparator();
-
-    public static Comparator<Object> getComparator() {
-        return _instance;
-    }
-
-    private TimeComparator() {
-    }
-
-    public static Comparable<Object> getComparable(final Object o) {
-        final Date dt1 = toDate(o);
-        return new Comparable<Object>() {
-
-            @Override
-            public boolean equals(Object obj) {
-                return _instance.equals(obj);
-            }
-
-            public int compareTo(Object o) {
-                return _instance.compare(dt1, o);
-            }
-
-            @Override
-            public String toString() {
-                return "TimeComparable[time=" + dt1 + "]";
-            }
-        };
-    }
-
-    public int compare(final Object o1, final Object o2) {
-        if (o1 == null && o2 == null) {
-            return 0;
-        }
-        if (o1 == null) {
-            return -1;
-        }
-        if (o2 == null) {
-            return 1;
-        }
-        try {
-            Date dt1 = toDate(o1);
-            Date dt2 = toDate(o2);
-            return dt1.compareTo(dt2);
-        } catch (Exception e) {
-            logger.error("Could not compare {} and {}", o1, o2);
-            throw new RuntimeException(e);
-        }
-    }
-
-    public static Date toDate(final Object value) {
-        Date result = null;
-        if (value == null) {
-            result = null;
-        } else if (value instanceof Date) {
-            result = (Date) value;
-        } else if (value instanceof Calendar) {
-            result = ((Calendar) value).getTime();
-        } else if (value instanceof String) {
-            result = convertFromString((String) value);
-        } else if (value instanceof Number) {
-            result = convertFromNumber((Number) value);
-        }
-
-        if (result == null) {
-            logger.warn("Could not convert '{}' to date, returning null", value);
-        }
-
-        return result;
-    }
-
-    public static boolean isTimeBased(Object o) {
-        if (o instanceof Date || o instanceof Calendar) {
-            return true;
-        }
-        return false;
-    }
-
-    private static Date convertFromString(final String value) {
-        try {
-            long longValue = Long.parseLong(value);
-            return convertFromNumber(longValue);
-        } catch (NumberFormatException e) {
-            // do nothing, proceed to dateFormat parsing
-        }
-
-        // try with Date.toString() date format first
-        try {
-            DateFormatSymbols dateFormatSymbols = DateFormatSymbols.getInstance(Locale.US);
-            SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", dateFormatSymbols);
-            return dateFormat.parse(value);
-        } catch (ParseException e) {
-            // do noting
-        }
-
-        for (String prototypePattern : prototypePatterns) {
-            if (prototypePattern.length() == value.length()) {
-                DateFormat dateFormat;
-                try {
-                    dateFormat = DateUtils.createDateFormat(prototypePattern);
-                    return dateFormat.parse(value);
-                } catch (Exception e) {
-                    // proceed to next formatter
-                }
-
-                if (prototypePattern.indexOf('-') != -1) {
-                    // try with '.' in stead of '-'
-                    try {
-                        dateFormat = DateUtils.createDateFormat(prototypePattern.replaceAll("\\-", "\\."));
-                        return dateFormat.parse(value);
-                    } catch (Exception e) {
-                        // proceed to next formatter
-                    }
-
-                    // try with '/' in stead of '-'
-                    try {
-                        dateFormat = DateUtils.createDateFormat(prototypePattern.replaceAll("\\-", "\\/"));
-                        return dateFormat.parse(value);
-                    } catch (Exception e) {
-                        // proceed to next formatter
-                    }
-                }
-            }
-
-        }
-
-        return null;
-    }
-
-    private static Date convertFromNumber(Number value) {
-        Number numberValue = (Number) value;
-        long longValue = numberValue.longValue();
-
-        String stringValue = Long.toString(longValue);
-        // test if the number is actually a format of the type yyyyMMdd
-        if (stringValue.length() == 8 && (stringValue.startsWith("1") || stringValue.startsWith("2"))) {
-            try {
-                return DateUtils.createDateFormat("yyyyMMdd").parse(stringValue);
-            } catch (Exception e) {
-                // do nothing, proceed to next method of conversion
-            }
-        }
-
-        // test if the number is actually a format of the type yyMMdd
-        if (stringValue.length() == 6) {
-            try {
-                return DateUtils.createDateFormat("yyMMdd").parse(stringValue);
-            } catch (Exception e) {
-                // do nothing, proceed to next method of conversion
-            }
-        }
-
-        if (longValue > 5000000) {
-            // this number is most probably amount of milliseconds since
-            // 1970
-            return new Date(longValue);
-        } else {
-            // this number is most probably the amount of days since
-            // 1970
-            return new Date(longValue * 1000 * 60 * 60 * 24);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/ToStringComparator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/ToStringComparator.java b/core/src/main/java/org/eobjects/metamodel/util/ToStringComparator.java
deleted file mode 100644
index cfca4c5..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/ToStringComparator.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.util.Comparator;
-
-/**
- * Uses the toString method for comparison of objects
- */
-public final class ToStringComparator implements Comparator<Object> {
-
-	private static Comparator<Object> _instance = new ToStringComparator();
-
-	public static Comparator<Object> getComparator() {
-		return _instance;
-	}
-
-	private ToStringComparator() {
-	}
-
-	public static Comparable<Object> getComparable(final Object o) {
-		final String s = o.toString();
-		return new Comparable<Object>() {
-			
-			@Override
-			public boolean equals(Object obj) {
-				return _instance.equals(obj);
-			}
-
-			public int compareTo(Object o2) {
-				return _instance.compare(s, o2);
-			}
-
-			@Override
-			public String toString() {
-				return "ToStringComparable[string=" + s + "]";
-			}
-		};
-	}
-
-	public int compare(Object o1, Object o2) {
-		if (o1 == null && o2 == null) {
-			return -1;
-		}
-		if (o1 == null) {
-			return -1;
-		}
-		if (o2 == null) {
-			return 1;
-		}
-		return o1.toString().compareTo(o2.toString());
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/TruePredicate.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/TruePredicate.java b/core/src/main/java/org/eobjects/metamodel/util/TruePredicate.java
deleted file mode 100644
index f99ed6d..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/TruePredicate.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.io.Serializable;
-
-/**
- * A predicate that is always true
- * 
- * @param <E>
- */
-public final class TruePredicate<E> implements Predicate<E>, Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    @Override
-    public Boolean eval(E arg) {
-        return true;
-    }
-    
-    @Override
-    public int hashCode() {
-        return Boolean.TRUE.hashCode();
-    }
-    
-    @Override
-    public boolean equals(Object obj) {
-        return obj != null && obj.getClass() == TruePredicate.class;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/UnicodeWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/UnicodeWriter.java b/core/src/main/java/org/eobjects/metamodel/util/UnicodeWriter.java
deleted file mode 100644
index c95f381..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/UnicodeWriter.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-
-/**
- * Writes Unicode text to an output stream. If the specified encoding is a
- * Unicode, then the text is preceeded by the proper Unicode BOM. If it is any
- * other encoding, this class behaves just like <code>OutputStreamWriter</code>.
- * This class is here because Java's <code>OutputStreamWriter</code> apparently
- * doesn't believe in writing BOMs.
- * <p>
- * 
- * For optimum performance, it is recommended that you wrap all instances of
- * <code>UnicodeWriter</code> with a <code>java.io.BufferedWriter</code>.
- * 
- * This file is a redistribution of Rubert Futrell from FifeSoft UnicodeWriter
- * (also LGPL licensed).
- * 
- * <pre>
- * UnicodeWriter.java - Writes Unicode output with the proper BOM.
- * Copyright (C) 2004 Robert Futrell
- * robert_futrell at users.sourceforge.net
- * http://fifesoft.com/rsyntaxtextarea
- * </pre>
- * 
- * @author Robert Futrell
- * @version 0.7
- */
-public class UnicodeWriter extends Writer {
-
-    public static final byte[] UTF8_BOM = new byte[] { (byte) 0xEF,
-            (byte) 0xBB, (byte) 0xBF };
-
-    public static final byte[] UTF16LE_BOM = new byte[] { (byte) 0xFF,
-            (byte) 0xFE };
-
-    public static final byte[] UTF16BE_BOM = new byte[] { (byte) 0xFE,
-            (byte) 0xFF };
-
-    public static final byte[] UTF32LE_BOM = new byte[] { (byte) 0xFF,
-            (byte) 0xFE, (byte) 0x00, (byte) 0x00 };
-
-    public static final byte[] UTF32BE_BOM = new byte[] { (byte) 0x00,
-            (byte) 0x00, (byte) 0xFE, (byte) 0xFF };
-
-    /**
-     * The writer actually doing the writing.
-     */
-    private final OutputStreamWriter writer;
-
-    /**
-     * This is a utility constructor since the vast majority of the time, this
-     * class will be used to write Unicode files.
-     * 
-     * @param fileName
-     *            The file to which to write the Unicode output.
-     * @param encoding
-     *            The encoding to use.
-     * @throws UnsupportedEncodingException
-     *             If the specified encoding is not supported.
-     * @throws IOException
-     *             If an IO exception occurs.
-     */
-    public UnicodeWriter(String fileName, String encoding)
-            throws UnsupportedEncodingException, IOException {
-        this(new FileOutputStream(fileName), encoding);
-    }
-
-    /**
-     * This is a utility constructor since the vast majority of the time, this
-     * class will be used to write Unicode files.
-     * 
-     * @param file
-     *            The file to which to write the Unicode output.
-     * @param encoding
-     *            The encoding to use.
-     * @throws UnsupportedEncodingException
-     *             If the specified encoding is not supported.
-     * @throws IOException
-     *             If an IO exception occurs.
-     */
-    public UnicodeWriter(File file, String encoding)
-            throws UnsupportedEncodingException, IOException {
-        this(new FileOutputStream(file), encoding);
-    }
-
-    /**
-     * Creates a new writer.
-     * 
-     * @param outputStream
-     *            The output stream to write.
-     * @param encoding
-     *            The encoding to use.
-     * @throws UnsupportedEncodingException
-     *             If the specified encoding is not supported.
-     * @throws IOException
-     *             If an IO exception occurs.
-     */
-    public UnicodeWriter(OutputStream outputStream, String encoding)
-            throws UnsupportedEncodingException, IOException {
-        writer = createWriter(outputStream, encoding);
-    }
-
-    /**
-     * Closes this writer.
-     * 
-     * @throws IOException
-     *             If an IO exception occurs.
-     */
-    @Override
-    public void close() throws IOException {
-        writer.close();
-    }
-
-    /**
-     * Flushes the stream.
-     * 
-     * @throws IOException
-     *             If an IO exception occurs.
-     */
-    @Override
-    public void flush() throws IOException {
-        writer.flush();
-    }
-
-    /**
-     * Initializes the internal output stream and writes the BOM if the
-     * specified encoding is a Unicode encoding.
-     * 
-     * @param outputStream
-     *            The output stream we are writing.
-     * @param encoding
-     *            The encoding in which to write.
-     * @throws UnsupportedEncodingException
-     *             If the specified encoding isn't supported.
-     * @throws IOException
-     *             If an I/O error occurs while writing a BOM.
-     */
-    private OutputStreamWriter createWriter(OutputStream outputStream,
-            String encoding) throws UnsupportedEncodingException, IOException {
-        OutputStreamWriter writer = new OutputStreamWriter(outputStream,
-                encoding);
-
-        // Write the proper BOM if they specified a Unicode encoding.
-        // NOTE: Creating an OutputStreamWriter with encoding "UTF-16"
-        // DOES write out the BOM; "UTF-16LE", "UTF-16BE", "UTF-32", "UTF-32LE"
-        // and "UTF-32BE" don't.
-        if ("UTF-8".equalsIgnoreCase(encoding)) {
-            outputStream.write(UTF8_BOM, 0, UTF8_BOM.length);
-        } else if ("UTF-16LE".equalsIgnoreCase(encoding)) {
-            outputStream.write(UTF16LE_BOM, 0, UTF16LE_BOM.length);
-        } else if (/* "UTF-16".equalsIgnoreCase(encoding) || */
-        "UTF-16BE".equalsIgnoreCase(encoding)) {
-            outputStream.write(UTF16BE_BOM, 0, UTF16BE_BOM.length);
-        } else if ("UTF-32LE".equalsIgnoreCase(encoding)) {
-            outputStream.write(UTF32LE_BOM, 0, UTF32LE_BOM.length);
-        } else if ("UTF-32".equalsIgnoreCase(encoding)
-                || "UTF-32BE".equalsIgnoreCase(encoding)) {
-            outputStream.write(UTF32BE_BOM, 0, UTF32BE_BOM.length);
-        }
-
-        return writer;
-    }
-
-    /**
-     * Writes a portion of an array of characters.
-     * 
-     * @param cbuf
-     *            The buffer of characters.
-     * @param off
-     *            The offset from which to start writing characters.
-     * @param len
-     *            The number of characters to write.
-     * @throws IOException
-     *             If an I/O error occurs.
-     */
-    @Override
-    public void write(char[] cbuf, int off, int len) throws IOException {
-        writer.write(cbuf, off, len);
-    }
-
-    /**
-     * Writes a single character.
-     * 
-     * @param c
-     *            An integer specifying the character to write.
-     * @throws IOException
-     *             If an IO error occurs.
-     */
-    @Override
-    public void write(int c) throws IOException {
-        writer.write(c);
-    }
-
-    /**
-     * Writes a portion of a string.
-     * 
-     * @param str
-     *            The string from which to write.
-     * @param off
-     *            The offset from which to start writing characters.
-     * @param len
-     *            The number of characters to write.
-     * @throws IOException
-     *             If an IO error occurs.
-     */
-    @Override
-    public void write(String str, int off, int len) throws IOException {
-        writer.write(str, off, len);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/UrlResource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/UrlResource.java b/core/src/main/java/org/eobjects/metamodel/util/UrlResource.java
deleted file mode 100644
index c79980a..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/UrlResource.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Serializable;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-/**
- * Resource based on URL or URI.
- */
-public class UrlResource implements Resource, Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private final URI _uri;
-
-    public UrlResource(URL url) {
-        try {
-            _uri = url.toURI();
-        } catch (URISyntaxException e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    public UrlResource(URI uri) {
-        _uri = uri;
-    }
-
-    public UrlResource(String urlString) {
-        try {
-            _uri = new URI(urlString);
-        } catch (URISyntaxException e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    @Override
-    public String toString() {
-        return "UrlResource[" + _uri + "]";
-    }
-
-    /**
-     * Gets the URI associated with this resource.
-     * 
-     * @return
-     */
-    public URI getUri() {
-        return _uri;
-    }
-
-    @Override
-    public String getName() {
-        final String name = _uri.toString();
-        final int lastSlash = name.lastIndexOf('/');
-        final int lastBackSlash = name.lastIndexOf('\\');
-        final int lastIndex = Math.max(lastSlash, lastBackSlash);
-        if (lastIndex != -1) {
-            final String lastPart = name.substring(lastIndex + 1);
-            if (!"".equals(lastPart)) {
-                return lastPart;
-            }
-        }
-        return name;
-    }
-
-    @Override
-    public boolean isReadOnly() {
-        return true;
-    }
-
-    @Override
-    public void write(Action<OutputStream> writeCallback) throws ResourceException {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public void append(Action<OutputStream> appendCallback) throws ResourceException {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public void read(Action<InputStream> readCallback) throws ResourceException {
-        final InputStream in = read();
-        try {
-            readCallback.run(in);
-        } catch (Exception e) {
-            throw new ResourceException(this, "Error occurred in read callback", e);
-        } finally {
-            FileHelper.safeClose(in);
-        }
-    }
-
-    @Override
-    public <E> E read(Func<InputStream, E> readCallback) throws ResourceException {
-        final InputStream in = read();
-        try {
-            E result = readCallback.eval(in);
-            return result;
-        } catch (Exception e) {
-            throw new ResourceException(this, "Error occurred in read callback", e);
-        } finally {
-            FileHelper.safeClose(in);
-        }
-    }
-
-    @Override
-    public boolean isExists() {
-        return true;
-    }
-
-    @Override
-    public long getSize() {
-        return -1;
-    }
-
-    @Override
-    public long getLastModified() {
-        return -1;
-    }
-
-    @Override
-    public InputStream read() throws ResourceException {
-        try {
-            return _uri.toURL().openStream();
-        } catch (Exception e) {
-            throw new ResourceException(this, "Failed to open InputStream", e);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/Weekday.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/Weekday.java b/core/src/main/java/org/eobjects/metamodel/util/Weekday.java
deleted file mode 100644
index d9ab224..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/Weekday.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.util.Calendar;
-
-/**
- * Provides a handy and type-safe enum around the weekdays otherwise defined as
- * int constants in java.util.Calendar.
- * 
- * @author Kasper Sørensen
- */
-public enum Weekday implements HasName {
-
-    MONDAY(Calendar.MONDAY),
-
-    TUESDAY(Calendar.TUESDAY),
-
-    WEDNESDAY(Calendar.WEDNESDAY),
-
-    THURSDAY(Calendar.THURSDAY),
-
-    FRIDAY(Calendar.FRIDAY),
-
-    SATURDAY(Calendar.SATURDAY),
-
-    SUNDAY(Calendar.SUNDAY);
-
-    private int calendarConstant;
-
-    private Weekday(int calendarConstant) {
-        this.calendarConstant = calendarConstant;
-    }
-
-    public int getCalendarConstant() {
-        return calendarConstant;
-    }
-
-    public static Weekday getByCalendarConstant(int calendarConstant) {
-        for (Weekday weekday : values()) {
-            if (weekday.getCalendarConstant() == calendarConstant) {
-                return weekday;
-            }
-        }
-        return null;
-    }
-
-    public Weekday next() {
-        if (this == SUNDAY) {
-            return MONDAY;
-        }
-        return values()[ordinal() + 1];
-    }
-
-    public Weekday previous() {
-        if (this == MONDAY) {
-            return SUNDAY;
-        }
-        return values()[ordinal() - 1];
-    }
-
-    @Override
-    public String getName() {
-        final String capitalized = toString();
-        return capitalized.charAt(0) + capitalized.substring(1).toLowerCase();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/WildcardPattern.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/WildcardPattern.java b/core/src/main/java/org/eobjects/metamodel/util/WildcardPattern.java
deleted file mode 100644
index 36f388a..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/WildcardPattern.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.eobjects.metamodel.util;
-
-import java.io.Serializable;
-import java.util.StringTokenizer;
-
-import org.eobjects.metamodel.query.FilterItem;
-
-/**
- * Represents a pattern with a wildcard character. These are typically used in
- * FilterItems with the LIKE operator.
- * 
- * @see FilterItem
- */
-public final class WildcardPattern implements Serializable {
-
-	private static final long serialVersionUID = 857462137797209624L;
-	private String _pattern;
-	private char _wildcard;
-	private boolean _endsWithDelim;
-
-	public WildcardPattern(String pattern, char wildcard) {
-		_pattern = pattern;
-		_wildcard = wildcard;
-		_endsWithDelim = (_pattern.charAt(pattern.length() - 1) == _wildcard);
-	}
-
-	public boolean matches(String value) {
-		if (value == null) {
-			return false;
-		}
-		StringTokenizer st = new StringTokenizer(_pattern,
-				Character.toString(_wildcard));
-		int charIndex = 0;
-		while (st.hasMoreTokens()) {
-			String token = st.nextToken();
-			charIndex = value.indexOf(token, charIndex);
-			if (charIndex == -1) {
-				return false;
-			}
-			charIndex = charIndex + token.length();
-		}
-		if (!_endsWithDelim) {
-			// Unless the last char of the pattern is a wildcard, we need to
-			// have reached the end of the string
-			if (charIndex != value.length()) {
-				return false;
-			}
-		}
-		return true;
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-metamodel/blob/e2e2b37a/core/src/main/java/org/eobjects/metamodel/util/package-info.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/eobjects/metamodel/util/package-info.java b/core/src/main/java/org/eobjects/metamodel/util/package-info.java
deleted file mode 100644
index 5130e4d..0000000
--- a/core/src/main/java/org/eobjects/metamodel/util/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/**
- * Utilities and convenient classes
- */
-package org.eobjects.metamodel.util;
-