target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testIsEmptyWithNonEmptyMap() { final MultiValuedMap<String, String> map = new ArrayListValuedHashMap<String, String>(); map.put("item", "value"); assertEquals(false, MultiMapUtils.isEmpty(map)); }
public static boolean isEmpty(final MultiValuedMap<?, ?> map) { return map == null || map.isEmpty(); }
MultiMapUtils { public static boolean isEmpty(final MultiValuedMap<?, ?> map) { return map == null || map.isEmpty(); } }
MultiMapUtils { public static boolean isEmpty(final MultiValuedMap<?, ?> map) { return map == null || map.isEmpty(); } private MultiMapUtils(); }
MultiMapUtils { public static boolean isEmpty(final MultiValuedMap<?, ?> map) { return map == null || map.isEmpty(); } private MultiMapUtils(); @SuppressWarnings("unchecked") static MultiValuedMap<K, V> emptyMultiValuedMap(); @SuppressWarnings("unchecked") static MultiValuedMap<K, V> emptyIfNull(final MultiValuedMap<K...
MultiMapUtils { public static boolean isEmpty(final MultiValuedMap<?, ?> map) { return map == null || map.isEmpty(); } private MultiMapUtils(); @SuppressWarnings("unchecked") static MultiValuedMap<K, V> emptyMultiValuedMap(); @SuppressWarnings("unchecked") static MultiValuedMap<K, V> emptyIfNull(final MultiValuedMap<K...
@Test public void testIsEmptyWithNull() { final MultiValuedMap<Object, Object> map = null; assertEquals(true, MultiMapUtils.isEmpty(map)); }
public static boolean isEmpty(final MultiValuedMap<?, ?> map) { return map == null || map.isEmpty(); }
MultiMapUtils { public static boolean isEmpty(final MultiValuedMap<?, ?> map) { return map == null || map.isEmpty(); } }
MultiMapUtils { public static boolean isEmpty(final MultiValuedMap<?, ?> map) { return map == null || map.isEmpty(); } private MultiMapUtils(); }
MultiMapUtils { public static boolean isEmpty(final MultiValuedMap<?, ?> map) { return map == null || map.isEmpty(); } private MultiMapUtils(); @SuppressWarnings("unchecked") static MultiValuedMap<K, V> emptyMultiValuedMap(); @SuppressWarnings("unchecked") static MultiValuedMap<K, V> emptyIfNull(final MultiValuedMap<K...
MultiMapUtils { public static boolean isEmpty(final MultiValuedMap<?, ?> map) { return map == null || map.isEmpty(); } private MultiMapUtils(); @SuppressWarnings("unchecked") static MultiValuedMap<K, V> emptyMultiValuedMap(); @SuppressWarnings("unchecked") static MultiValuedMap<K, V> emptyIfNull(final MultiValuedMap<K...
@Test public void testGetCollection() { assertNull(MultiMapUtils.getCollection(null, "key1")); String values[] = { "v1", "v2", "v3" }; final MultiValuedMap<String, String> map = new ArrayListValuedHashMap<String, String>(); for (String val : values) { map.put("key1", val); } Collection<String> col = MultiMapUtils.getCo...
public static <K, V> Collection<V> getCollection(final MultiValuedMap<K, V> map, final K key) { if (map != null) { return map.get(key); } return null; }
MultiMapUtils { public static <K, V> Collection<V> getCollection(final MultiValuedMap<K, V> map, final K key) { if (map != null) { return map.get(key); } return null; } }
MultiMapUtils { public static <K, V> Collection<V> getCollection(final MultiValuedMap<K, V> map, final K key) { if (map != null) { return map.get(key); } return null; } private MultiMapUtils(); }
MultiMapUtils { public static <K, V> Collection<V> getCollection(final MultiValuedMap<K, V> map, final K key) { if (map != null) { return map.get(key); } return null; } private MultiMapUtils(); @SuppressWarnings("unchecked") static MultiValuedMap<K, V> emptyMultiValuedMap(); @SuppressWarnings("unchecked") static Multi...
MultiMapUtils { public static <K, V> Collection<V> getCollection(final MultiValuedMap<K, V> map, final K key) { if (map != null) { return map.get(key); } return null; } private MultiMapUtils(); @SuppressWarnings("unchecked") static MultiValuedMap<K, V> emptyMultiValuedMap(); @SuppressWarnings("unchecked") static Multi...
@Test public void testGetValuesAsList() { assertNull(MultiMapUtils.getValuesAsList(null, "key1")); String values[] = { "v1", "v2", "v3" }; final MultiValuedMap<String, String> map = new ArrayListValuedHashMap<String, String>(); for (String val : values) { map.put("key1", val); } List<String> list = MultiMapUtils.getVal...
public static <K, V> List<V> getValuesAsList(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof List) { return (List<V>) col; } return new ArrayList<V>(col); } return null; }
MultiMapUtils { public static <K, V> List<V> getValuesAsList(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof List) { return (List<V>) col; } return new ArrayList<V>(col); } return null; } }
MultiMapUtils { public static <K, V> List<V> getValuesAsList(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof List) { return (List<V>) col; } return new ArrayList<V>(col); } return null; } private MultiMapUtils(); }
MultiMapUtils { public static <K, V> List<V> getValuesAsList(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof List) { return (List<V>) col; } return new ArrayList<V>(col); } return null; } private MultiMapUtils(); @SuppressWarnings("unchecked") stat...
MultiMapUtils { public static <K, V> List<V> getValuesAsList(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof List) { return (List<V>) col; } return new ArrayList<V>(col); } return null; } private MultiMapUtils(); @SuppressWarnings("unchecked") stat...
@Test public void testGetValuesAsSet() { assertNull(MultiMapUtils.getValuesAsList(null, "key1")); String values[] = { "v1", "v2", "v3" }; final MultiValuedMap<String, String> map = new ArrayListValuedHashMap<String, String>(); for (String val : values) { map.put("key1", val); map.put("key1", val); } Set<String> set = M...
public static <K, V> Set<V> getValuesAsSet(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof Set) { return (Set<V>) col; } return new HashSet<V>(col); } return null; }
MultiMapUtils { public static <K, V> Set<V> getValuesAsSet(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof Set) { return (Set<V>) col; } return new HashSet<V>(col); } return null; } }
MultiMapUtils { public static <K, V> Set<V> getValuesAsSet(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof Set) { return (Set<V>) col; } return new HashSet<V>(col); } return null; } private MultiMapUtils(); }
MultiMapUtils { public static <K, V> Set<V> getValuesAsSet(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof Set) { return (Set<V>) col; } return new HashSet<V>(col); } return null; } private MultiMapUtils(); @SuppressWarnings("unchecked") static Mul...
MultiMapUtils { public static <K, V> Set<V> getValuesAsSet(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof Set) { return (Set<V>) col; } return new HashSet<V>(col); } return null; } private MultiMapUtils(); @SuppressWarnings("unchecked") static Mul...
@Test public void testGetValuesAsBag() { assertNull(MultiMapUtils.getValuesAsBag(null, "key1")); String values[] = { "v1", "v2", "v3" }; final MultiValuedMap<String, String> map = new ArrayListValuedHashMap<String, String>(); for (String val : values) { map.put("key1", val); map.put("key1", val); } Bag<String> bag = Mu...
public static <K, V> Bag<V> getValuesAsBag(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof Bag) { return (Bag<V>) col; } return new HashBag<V>(col); } return null; }
MultiMapUtils { public static <K, V> Bag<V> getValuesAsBag(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof Bag) { return (Bag<V>) col; } return new HashBag<V>(col); } return null; } }
MultiMapUtils { public static <K, V> Bag<V> getValuesAsBag(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof Bag) { return (Bag<V>) col; } return new HashBag<V>(col); } return null; } private MultiMapUtils(); }
MultiMapUtils { public static <K, V> Bag<V> getValuesAsBag(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof Bag) { return (Bag<V>) col; } return new HashBag<V>(col); } return null; } private MultiMapUtils(); @SuppressWarnings("unchecked") static Mul...
MultiMapUtils { public static <K, V> Bag<V> getValuesAsBag(final MultiValuedMap<K, V> map, final K key) { if (map != null) { Collection<V> col = map.get(key); if (col instanceof Bag) { return (Bag<V>) col; } return new HashBag<V>(col); } return null; } private MultiMapUtils(); @SuppressWarnings("unchecked") static Mul...
@Test public void testUpdateReturnVoid() throws Exception { TypeToken<User> pt = TypeToken.of(User.class); TypeToken<Void> rt = TypeToken.of(void.class); String srcSql = "update user set name=:1.name where id=:1.id"; AbstractOperator operator = getOperator(pt, rt, srcSql); operator.setJdbcOperations(new JdbcOperationsA...
@Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
@Test public void testpredicatedSet() { final Predicate<Object> predicate = new Predicate<Object>() { @Override public boolean evaluate(final Object o) { return o instanceof String; } }; Set<Object> set = SetUtils.predicatedSet(new HashSet<Object>(), predicate); assertTrue("returned object should be a PredicatedSet", s...
public static <E> Set<E> predicatedSet(final Set<E> set, final Predicate<? super E> predicate) { return PredicatedSet.predicatedSet(set, predicate); }
SetUtils { public static <E> Set<E> predicatedSet(final Set<E> set, final Predicate<? super E> predicate) { return PredicatedSet.predicatedSet(set, predicate); } }
SetUtils { public static <E> Set<E> predicatedSet(final Set<E> set, final Predicate<? super E> predicate) { return PredicatedSet.predicatedSet(set, predicate); } private SetUtils(); }
SetUtils { public static <E> Set<E> predicatedSet(final Set<E> set, final Predicate<? super E> predicate) { return PredicatedSet.predicatedSet(set, predicate); } private SetUtils(); static Set<E> emptySet(); @SuppressWarnings("unchecked") // empty set is OK for any type static SortedSet<E> emptySortedSet(); static Set...
SetUtils { public static <E> Set<E> predicatedSet(final Set<E> set, final Predicate<? super E> predicate) { return PredicatedSet.predicatedSet(set, predicate); } private SetUtils(); static Set<E> emptySet(); @SuppressWarnings("unchecked") // empty set is OK for any type static SortedSet<E> emptySortedSet(); static Set...
@Test public void testEmptyIfNull() { assertTrue(SetUtils.emptyIfNull(null).isEmpty()); final Set<Long> set = new HashSet<Long>(); assertSame(set, SetUtils.emptyIfNull(set)); }
public static <T> Set<T> emptyIfNull(final Set<T> set) { return set == null ? Collections.<T>emptySet() : set; }
SetUtils { public static <T> Set<T> emptyIfNull(final Set<T> set) { return set == null ? Collections.<T>emptySet() : set; } }
SetUtils { public static <T> Set<T> emptyIfNull(final Set<T> set) { return set == null ? Collections.<T>emptySet() : set; } private SetUtils(); }
SetUtils { public static <T> Set<T> emptyIfNull(final Set<T> set) { return set == null ? Collections.<T>emptySet() : set; } private SetUtils(); static Set<E> emptySet(); @SuppressWarnings("unchecked") // empty set is OK for any type static SortedSet<E> emptySortedSet(); static Set<T> emptyIfNull(final Set<T> set); sta...
SetUtils { public static <T> Set<T> emptyIfNull(final Set<T> set) { return set == null ? Collections.<T>emptySet() : set; } private SetUtils(); static Set<E> emptySet(); @SuppressWarnings("unchecked") // empty set is OK for any type static SortedSet<E> emptySortedSet(); static Set<T> emptyIfNull(final Set<T> set); sta...
@Test public void testEquals() { final Collection<String> data = Arrays.asList("a", "b", "c"); final Set<String> a = new HashSet<String>(data); final Set<String> b = new HashSet<String>(data); assertEquals(true, a.equals(b)); assertEquals(true, SetUtils.isEqualSet(a, b)); a.clear(); assertEquals(false, SetUtils.isEqual...
public static boolean isEqualSet(final Collection<?> set1, final Collection<?> set2) { if (set1 == set2) { return true; } if (set1 == null || set2 == null || set1.size() != set2.size()) { return false; } return set1.containsAll(set2); }
SetUtils { public static boolean isEqualSet(final Collection<?> set1, final Collection<?> set2) { if (set1 == set2) { return true; } if (set1 == null || set2 == null || set1.size() != set2.size()) { return false; } return set1.containsAll(set2); } }
SetUtils { public static boolean isEqualSet(final Collection<?> set1, final Collection<?> set2) { if (set1 == set2) { return true; } if (set1 == null || set2 == null || set1.size() != set2.size()) { return false; } return set1.containsAll(set2); } private SetUtils(); }
SetUtils { public static boolean isEqualSet(final Collection<?> set1, final Collection<?> set2) { if (set1 == set2) { return true; } if (set1 == null || set2 == null || set1.size() != set2.size()) { return false; } return set1.containsAll(set2); } private SetUtils(); static Set<E> emptySet(); @SuppressWarnings("unchec...
SetUtils { public static boolean isEqualSet(final Collection<?> set1, final Collection<?> set2) { if (set1 == set2) { return true; } if (set1 == null || set2 == null || set1.size() != set2.size()) { return false; } return set1.containsAll(set2); } private SetUtils(); static Set<E> emptySet(); @SuppressWarnings("unchec...
@Test public void testHashCode() { final Collection<String> data = Arrays.asList("a", "b", "c"); final Set<String> a = new HashSet<String>(data); final Set<String> b = new HashSet<String>(data); assertEquals(true, a.hashCode() == b.hashCode()); assertEquals(true, a.hashCode() == SetUtils.hashCodeForSet(a)); assertEqual...
public static <T> int hashCodeForSet(final Collection<T> set) { if (set == null) { return 0; } int hashCode = 0; for (final T obj : set) { if (obj != null) { hashCode += obj.hashCode(); } } return hashCode; }
SetUtils { public static <T> int hashCodeForSet(final Collection<T> set) { if (set == null) { return 0; } int hashCode = 0; for (final T obj : set) { if (obj != null) { hashCode += obj.hashCode(); } } return hashCode; } }
SetUtils { public static <T> int hashCodeForSet(final Collection<T> set) { if (set == null) { return 0; } int hashCode = 0; for (final T obj : set) { if (obj != null) { hashCode += obj.hashCode(); } } return hashCode; } private SetUtils(); }
SetUtils { public static <T> int hashCodeForSet(final Collection<T> set) { if (set == null) { return 0; } int hashCode = 0; for (final T obj : set) { if (obj != null) { hashCode += obj.hashCode(); } } return hashCode; } private SetUtils(); static Set<E> emptySet(); @SuppressWarnings("unchecked") // empty set is OK for...
SetUtils { public static <T> int hashCodeForSet(final Collection<T> set) { if (set == null) { return 0; } int hashCode = 0; for (final T obj : set) { if (obj != null) { hashCode += obj.hashCode(); } } return hashCode; } private SetUtils(); static Set<E> emptySet(); @SuppressWarnings("unchecked") // empty set is OK for...
@Test public void testNewIdentityHashSet() { Set<String> set = SetUtils.newIdentityHashSet(); String a = new String("a"); set.add(a); set.add(new String("b")); set.add(a); assertEquals(2, set.size()); set.add(new String("a")); assertEquals(3, set.size()); set.remove(a); assertEquals(2, set.size()); }
public static <E> Set<E> newIdentityHashSet() { return Collections.newSetFromMap(new IdentityHashMap<E, Boolean>()); }
SetUtils { public static <E> Set<E> newIdentityHashSet() { return Collections.newSetFromMap(new IdentityHashMap<E, Boolean>()); } }
SetUtils { public static <E> Set<E> newIdentityHashSet() { return Collections.newSetFromMap(new IdentityHashMap<E, Boolean>()); } private SetUtils(); }
SetUtils { public static <E> Set<E> newIdentityHashSet() { return Collections.newSetFromMap(new IdentityHashMap<E, Boolean>()); } private SetUtils(); static Set<E> emptySet(); @SuppressWarnings("unchecked") // empty set is OK for any type static SortedSet<E> emptySortedSet(); static Set<T> emptyIfNull(final Set<T> set...
SetUtils { public static <E> Set<E> newIdentityHashSet() { return Collections.newSetFromMap(new IdentityHashMap<E, Boolean>()); } private SetUtils(); static Set<E> emptySet(); @SuppressWarnings("unchecked") // empty set is OK for any type static SortedSet<E> emptySortedSet(); static Set<T> emptyIfNull(final Set<T> set...
@Test public void union() { final SetView<Integer> set = SetUtils.union(setA, setB); assertEquals(7, set.size()); assertTrue(set.containsAll(setA)); assertTrue(set.containsAll(setB)); final Set<Integer> set2 = SetUtils.union(setA, SetUtils.<Integer>emptySet()); assertEquals(setA, set2); try { SetUtils.union(setA, null)...
public static <E> SetView<E> union(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final SetView<E> bMinusA = difference(b, a); return new SetView<E>() { @Override public boolean contains(Object o) { return a.contains(o) || ...
SetUtils { public static <E> SetView<E> union(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final SetView<E> bMinusA = difference(b, a); return new SetView<E>() { @Override public boolean contains(Object o) { return a.cont...
SetUtils { public static <E> SetView<E> union(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final SetView<E> bMinusA = difference(b, a); return new SetView<E>() { @Override public boolean contains(Object o) { return a.cont...
SetUtils { public static <E> SetView<E> union(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final SetView<E> bMinusA = difference(b, a); return new SetView<E>() { @Override public boolean contains(Object o) { return a.cont...
SetUtils { public static <E> SetView<E> union(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final SetView<E> bMinusA = difference(b, a); return new SetView<E>() { @Override public boolean contains(Object o) { return a.cont...
@Test public void difference() { final SetView<Integer> set = SetUtils.difference(setA, setB); assertEquals(2, set.size()); assertTrue(set.contains(1)); assertTrue(set.contains(2)); for (Integer i : setB) { assertFalse(set.contains(i)); } final Set<Integer> set2 = SetUtils.difference(setA, SetUtils.<Integer>emptySet())...
public static <E> SetView<E> difference(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final Predicate<E> notContainedInB = new Predicate<E>() { @Override public boolean evaluate(E object) { return !b.contains(object); } };...
SetUtils { public static <E> SetView<E> difference(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final Predicate<E> notContainedInB = new Predicate<E>() { @Override public boolean evaluate(E object) { return !b.contains(ob...
SetUtils { public static <E> SetView<E> difference(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final Predicate<E> notContainedInB = new Predicate<E>() { @Override public boolean evaluate(E object) { return !b.contains(ob...
SetUtils { public static <E> SetView<E> difference(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final Predicate<E> notContainedInB = new Predicate<E>() { @Override public boolean evaluate(E object) { return !b.contains(ob...
SetUtils { public static <E> SetView<E> difference(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final Predicate<E> notContainedInB = new Predicate<E>() { @Override public boolean evaluate(E object) { return !b.contains(ob...
@Test public void intersection() { final SetView<Integer> set = SetUtils.intersection(setA, setB); assertEquals(3, set.size()); assertTrue(set.contains(3)); assertTrue(set.contains(4)); assertTrue(set.contains(5)); assertFalse(set.contains(1)); assertFalse(set.contains(2)); assertFalse(set.contains(6)); assertFalse(set...
public static <E> SetView<E> intersection(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final Predicate<E> containedInB = new Predicate<E>() { @Override public boolean evaluate(E object) { return b.contains(object); } }; r...
SetUtils { public static <E> SetView<E> intersection(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final Predicate<E> containedInB = new Predicate<E>() { @Override public boolean evaluate(E object) { return b.contains(obje...
SetUtils { public static <E> SetView<E> intersection(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final Predicate<E> containedInB = new Predicate<E>() { @Override public boolean evaluate(E object) { return b.contains(obje...
SetUtils { public static <E> SetView<E> intersection(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final Predicate<E> containedInB = new Predicate<E>() { @Override public boolean evaluate(E object) { return b.contains(obje...
SetUtils { public static <E> SetView<E> intersection(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final Predicate<E> containedInB = new Predicate<E>() { @Override public boolean evaluate(E object) { return b.contains(obje...
@Test public void disjunction() { final SetView<Integer> set = SetUtils.disjunction(setA, setB); assertEquals(4, set.size()); assertTrue(set.contains(1)); assertTrue(set.contains(2)); assertTrue(set.contains(6)); assertTrue(set.contains(7)); assertFalse(set.contains(3)); assertFalse(set.contains(4)); assertFalse(set.co...
public static <E> SetView<E> disjunction(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final SetView<E> aMinusB = difference(a, b); final SetView<E> bMinusA = difference(b, a); return new SetView<E>() { @Override public bo...
SetUtils { public static <E> SetView<E> disjunction(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final SetView<E> aMinusB = difference(a, b); final SetView<E> bMinusA = difference(b, a); return new SetView<E>() { @Overrid...
SetUtils { public static <E> SetView<E> disjunction(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final SetView<E> aMinusB = difference(a, b); final SetView<E> bMinusA = difference(b, a); return new SetView<E>() { @Overrid...
SetUtils { public static <E> SetView<E> disjunction(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final SetView<E> aMinusB = difference(a, b); final SetView<E> bMinusA = difference(b, a); return new SetView<E>() { @Overrid...
SetUtils { public static <E> SetView<E> disjunction(final Set<? extends E> a, final Set<? extends E> b) { if (a == null || b == null) { throw new NullPointerException("Sets must not be null."); } final SetView<E> aMinusB = difference(a, b); final SetView<E> bMinusA = difference(b, a); return new SetView<E>() { @Overrid...
@Test public void testExceptionFactory() { assertNotNull(FactoryUtils.exceptionFactory()); assertSame(FactoryUtils.exceptionFactory(), FactoryUtils.exceptionFactory()); try { FactoryUtils.exceptionFactory().create(); } catch (final FunctorException ex) { try { FactoryUtils.exceptionFactory().create(); } catch (final Fu...
public static <T> Factory<T> exceptionFactory() { return ExceptionFactory.<T>exceptionFactory(); }
FactoryUtils { public static <T> Factory<T> exceptionFactory() { return ExceptionFactory.<T>exceptionFactory(); } }
FactoryUtils { public static <T> Factory<T> exceptionFactory() { return ExceptionFactory.<T>exceptionFactory(); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> exceptionFactory() { return ExceptionFactory.<T>exceptionFactory(); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> prototypeFactory(final T protot...
FactoryUtils { public static <T> Factory<T> exceptionFactory() { return ExceptionFactory.<T>exceptionFactory(); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> prototypeFactory(final T protot...
@Test public void testUpdateReturnBoolean() throws Exception { TypeToken<User> pt = TypeToken.of(User.class); TypeToken<Boolean> rt = TypeToken.of(boolean.class); String srcSql = "update user set name=:1.name where id=:1.id"; AbstractOperator operator = getOperator(pt, rt, srcSql); operator.setJdbcOperations(new JdbcOp...
@Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
@Test public void testNullFactory() { final Factory<Object> factory = FactoryUtils.nullFactory(); assertNotNull(factory); final Object created = factory.create(); assertNull(created); }
public static <T> Factory<T> nullFactory() { return ConstantFactory.<T>constantFactory(null); }
FactoryUtils { public static <T> Factory<T> nullFactory() { return ConstantFactory.<T>constantFactory(null); } }
FactoryUtils { public static <T> Factory<T> nullFactory() { return ConstantFactory.<T>constantFactory(null); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> nullFactory() { return ConstantFactory.<T>constantFactory(null); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> prototypeFactory(final T prototype...
FactoryUtils { public static <T> Factory<T> nullFactory() { return ConstantFactory.<T>constantFactory(null); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> prototypeFactory(final T prototype...
@Test public void testConstantFactoryNull() { final Factory<Object> factory = FactoryUtils.constantFactory(null); assertNotNull(factory); final Object created = factory.create(); assertNull(created); }
public static <T> Factory<T> constantFactory(final T constantToReturn) { return ConstantFactory.constantFactory(constantToReturn); }
FactoryUtils { public static <T> Factory<T> constantFactory(final T constantToReturn) { return ConstantFactory.constantFactory(constantToReturn); } }
FactoryUtils { public static <T> Factory<T> constantFactory(final T constantToReturn) { return ConstantFactory.constantFactory(constantToReturn); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> constantFactory(final T constantToReturn) { return ConstantFactory.constantFactory(constantToReturn); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<...
FactoryUtils { public static <T> Factory<T> constantFactory(final T constantToReturn) { return ConstantFactory.constantFactory(constantToReturn); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<...
@Test public void testConstantFactoryConstant() { final Integer constant = Integer.valueOf(9); final Factory<Integer> factory = FactoryUtils.constantFactory(constant); assertNotNull(factory); final Integer created = factory.create(); assertSame(constant, created); }
public static <T> Factory<T> constantFactory(final T constantToReturn) { return ConstantFactory.constantFactory(constantToReturn); }
FactoryUtils { public static <T> Factory<T> constantFactory(final T constantToReturn) { return ConstantFactory.constantFactory(constantToReturn); } }
FactoryUtils { public static <T> Factory<T> constantFactory(final T constantToReturn) { return ConstantFactory.constantFactory(constantToReturn); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> constantFactory(final T constantToReturn) { return ConstantFactory.constantFactory(constantToReturn); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<...
FactoryUtils { public static <T> Factory<T> constantFactory(final T constantToReturn) { return ConstantFactory.constantFactory(constantToReturn); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<...
@Test public void testPrototypeFactoryNull() { assertSame(ConstantFactory.NULL_INSTANCE, FactoryUtils.prototypeFactory(null)); }
public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> proto...
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> proto...
@Test public void testPrototypeFactoryPublicCloneMethod() throws Exception { final Date proto = new Date(); final Factory<Date> factory = FactoryUtils.prototypeFactory(proto); assertNotNull(factory); final Date created = factory.create(); assertTrue(proto != created); assertEquals(proto, created); }
public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> proto...
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> proto...
@Test public void testPrototypeFactoryPublicCopyConstructor() throws Exception { final Mock1 proto = new Mock1(6); Factory<Object> factory = FactoryUtils.<Object>prototypeFactory(proto); assertNotNull(factory); final Object created = factory.create(); assertTrue(proto != created); assertEquals(proto, created); }
public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> proto...
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> proto...
@Test public void testPrototypeFactoryPublicSerialization() throws Exception { final Integer proto = Integer.valueOf(9); final Factory<Integer> factory = FactoryUtils.prototypeFactory(proto); assertNotNull(factory); final Integer created = factory.create(); assertTrue(proto != created); assertEquals(proto, created); }
public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> proto...
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> proto...
@Test public void testPrototypeFactoryPublicSerializationError() { final Mock2 proto = new Mock2(new Object()); final Factory<Object> factory = FactoryUtils.<Object>prototypeFactory(proto); assertNotNull(factory); try { factory.create(); } catch (final FunctorException ex) { assertTrue(ex.getCause() instanceof IOExcept...
public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> proto...
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> proto...
@Test public void testPrototypeFactoryPublicBad() { final Object proto = new Object(); try { FactoryUtils.prototypeFactory(proto); } catch (final IllegalArgumentException ex) { return; } fail(); }
public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> proto...
FactoryUtils { public static <T> Factory<T> prototypeFactory(final T prototype) { return PrototypeFactory.<T>prototypeFactory(prototype); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T constantToReturn); static Factory<T> proto...
@Test(expected=NullPointerException.class) public void instantiateFactoryNull() { FactoryUtils.instantiateFactory(null); }
public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T co...
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T co...
@Test public void testUpdateReturnGeneratedIdInt() throws Exception { TypeToken<User> pt = TypeToken.of(User.class); TypeToken<Integer> rt = TypeToken.of(int.class); String srcSql = "insert into user(id, name) values(:1.id, :1.name)"; AbstractOperator operator = getOperatorReturnGeneratedId(pt, rt, srcSql); operator.se...
@Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
@Test public void instantiateFactorySimple() { final Factory<Mock3> factory = FactoryUtils.instantiateFactory(Mock3.class); assertNotNull(factory); Mock3 created = factory.create(); assertEquals(0, created.getValue()); created = factory.create(); assertEquals(1, created.getValue()); }
public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T co...
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T co...
@Test(expected=IllegalArgumentException.class) public void instantiateFactoryMismatch() { FactoryUtils.instantiateFactory(Date.class, null, new Object[] {null}); }
public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T co...
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T co...
@Test(expected=IllegalArgumentException.class) public void instantiateFactoryNoConstructor() { FactoryUtils.instantiateFactory(Date.class, new Class[] {Long.class}, new Object[] {null}); }
public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T co...
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T co...
@Test public void instantiateFactoryComplex() { TimeZone.setDefault(TimeZone.getTimeZone("GMT")); final Factory<Date> factory = FactoryUtils.instantiateFactory(Date.class, new Class[] {Integer.TYPE, Integer.TYPE, Integer.TYPE}, new Object[] {Integer.valueOf(70), Integer.valueOf(0), Integer.valueOf(2)}); assertNotNull(f...
public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); }
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T co...
FactoryUtils { public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate) { return InstantiateFactory.instantiateFactory(classToInstantiate, null, null); } private FactoryUtils(); static Factory<T> exceptionFactory(); static Factory<T> nullFactory(); static Factory<T> constantFactory(final T co...
@Test public void booleanComparator() { Comparator<Boolean> comp = ComparatorUtils.booleanComparator(true); assertTrue(comp.compare(Boolean.TRUE, Boolean.FALSE) < 0); assertTrue(comp.compare(Boolean.TRUE, Boolean.TRUE) == 0); assertTrue(comp.compare(Boolean.FALSE, Boolean.TRUE) > 0); comp = ComparatorUtils.booleanCompa...
public static Comparator<Boolean> booleanComparator(final boolean trueFirst) { return BooleanComparator.booleanComparator(trueFirst); }
ComparatorUtils { public static Comparator<Boolean> booleanComparator(final boolean trueFirst) { return BooleanComparator.booleanComparator(trueFirst); } }
ComparatorUtils { public static Comparator<Boolean> booleanComparator(final boolean trueFirst) { return BooleanComparator.booleanComparator(trueFirst); } private ComparatorUtils(); }
ComparatorUtils { public static Comparator<Boolean> booleanComparator(final boolean trueFirst) { return BooleanComparator.booleanComparator(trueFirst); } private ComparatorUtils(); @SuppressWarnings("unchecked") static Comparator<E> naturalComparator(); static Comparator<E> chainedComparator(final Comparator<E>... com...
ComparatorUtils { public static Comparator<Boolean> booleanComparator(final boolean trueFirst) { return BooleanComparator.booleanComparator(trueFirst); } private ComparatorUtils(); @SuppressWarnings("unchecked") static Comparator<E> naturalComparator(); static Comparator<E> chainedComparator(final Comparator<E>... com...
@Test public void chainedComparator() { Comparator<Integer> comp = ComparatorUtils.chainedComparator(ComparatorUtils.<Integer>naturalComparator(), ComparatorUtils.<Integer>naturalComparator()); assertTrue(comp.compare(1, 2) < 0); assertTrue(comp.compare(1, 1) == 0); assertTrue(comp.compare(2, 1) > 0); }
public static <E> Comparator<E> chainedComparator(final Comparator<E>... comparators) { final ComparatorChain<E> chain = new ComparatorChain<E>(); for (final Comparator<E> comparator : comparators) { if (comparator == null) { throw new NullPointerException("Comparator cannot be null"); } chain.addComparator(comparator)...
ComparatorUtils { public static <E> Comparator<E> chainedComparator(final Comparator<E>... comparators) { final ComparatorChain<E> chain = new ComparatorChain<E>(); for (final Comparator<E> comparator : comparators) { if (comparator == null) { throw new NullPointerException("Comparator cannot be null"); } chain.addComp...
ComparatorUtils { public static <E> Comparator<E> chainedComparator(final Comparator<E>... comparators) { final ComparatorChain<E> chain = new ComparatorChain<E>(); for (final Comparator<E> comparator : comparators) { if (comparator == null) { throw new NullPointerException("Comparator cannot be null"); } chain.addComp...
ComparatorUtils { public static <E> Comparator<E> chainedComparator(final Comparator<E>... comparators) { final ComparatorChain<E> chain = new ComparatorChain<E>(); for (final Comparator<E> comparator : comparators) { if (comparator == null) { throw new NullPointerException("Comparator cannot be null"); } chain.addComp...
ComparatorUtils { public static <E> Comparator<E> chainedComparator(final Comparator<E>... comparators) { final ComparatorChain<E> chain = new ComparatorChain<E>(); for (final Comparator<E> comparator : comparators) { if (comparator == null) { throw new NullPointerException("Comparator cannot be null"); } chain.addComp...
@Test public void max() { Comparator<Integer> reversed = ComparatorUtils.reversedComparator(ComparatorUtils.<Integer>naturalComparator()); assertEquals(Integer.valueOf(10), ComparatorUtils.max(1, 10, null)); assertEquals(Integer.valueOf(10), ComparatorUtils.max(10, -10, null)); assertEquals(Integer.valueOf(1), Comparat...
@SuppressWarnings("unchecked") public static <E> E max(final E o1, final E o2, Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } final int c = comparator.compare(o1, o2); return c > 0 ? o1 : o2; }
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> E max(final E o1, final E o2, Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } final int c = comparator.compare(o1, o2); return c > 0 ? o1 : o2; } }
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> E max(final E o1, final E o2, Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } final int c = comparator.compare(o1, o2); return c > 0 ? o1 : o2; } private ComparatorUtils(); }
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> E max(final E o1, final E o2, Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } final int c = comparator.compare(o1, o2); return c > 0 ? o1 : o2; } private ComparatorUtils(); @SuppressWarnings("unchecked") static ...
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> E max(final E o1, final E o2, Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } final int c = comparator.compare(o1, o2); return c > 0 ? o1 : o2; } private ComparatorUtils(); @SuppressWarnings("unchecked") static ...
@Test public void min() { Comparator<Integer> reversed = ComparatorUtils.reversedComparator(ComparatorUtils.<Integer>naturalComparator()); assertEquals(Integer.valueOf(1), ComparatorUtils.min(1, 10, null)); assertEquals(Integer.valueOf(-10), ComparatorUtils.min(10, -10, null)); assertEquals(Integer.valueOf(10), Compara...
@SuppressWarnings("unchecked") public static <E> E min(final E o1, final E o2, Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } final int c = comparator.compare(o1, o2); return c < 0 ? o1 : o2; }
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> E min(final E o1, final E o2, Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } final int c = comparator.compare(o1, o2); return c < 0 ? o1 : o2; } }
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> E min(final E o1, final E o2, Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } final int c = comparator.compare(o1, o2); return c < 0 ? o1 : o2; } private ComparatorUtils(); }
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> E min(final E o1, final E o2, Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } final int c = comparator.compare(o1, o2); return c < 0 ? o1 : o2; } private ComparatorUtils(); @SuppressWarnings("unchecked") static ...
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> E min(final E o1, final E o2, Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } final int c = comparator.compare(o1, o2); return c < 0 ? o1 : o2; } private ComparatorUtils(); @SuppressWarnings("unchecked") static ...
@Test public void nullLowComparator() { Comparator<Integer> comp = ComparatorUtils.nullLowComparator(null); assertTrue(comp.compare(null, 10) < 0); assertTrue(comp.compare(null, null) == 0); assertTrue(comp.compare(10, null) > 0); }
@SuppressWarnings("unchecked") public static <E> Comparator<E> nullLowComparator(Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } return new NullComparator<E>(comparator, false); }
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> Comparator<E> nullLowComparator(Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } return new NullComparator<E>(comparator, false); } }
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> Comparator<E> nullLowComparator(Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } return new NullComparator<E>(comparator, false); } private ComparatorUtils(); }
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> Comparator<E> nullLowComparator(Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } return new NullComparator<E>(comparator, false); } private ComparatorUtils(); @SuppressWarnings("unchecked") static Comparator<E> n...
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> Comparator<E> nullLowComparator(Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } return new NullComparator<E>(comparator, false); } private ComparatorUtils(); @SuppressWarnings("unchecked") static Comparator<E> n...
@Test public void nullHighComparator() { Comparator<Integer> comp = ComparatorUtils.nullHighComparator(null); assertTrue(comp.compare(null, 10) > 0); assertTrue(comp.compare(null, null) == 0); assertTrue(comp.compare(10, null) < 0); }
@SuppressWarnings("unchecked") public static <E> Comparator<E> nullHighComparator(Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } return new NullComparator<E>(comparator, true); }
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> Comparator<E> nullHighComparator(Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } return new NullComparator<E>(comparator, true); } }
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> Comparator<E> nullHighComparator(Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } return new NullComparator<E>(comparator, true); } private ComparatorUtils(); }
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> Comparator<E> nullHighComparator(Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } return new NullComparator<E>(comparator, true); } private ComparatorUtils(); @SuppressWarnings("unchecked") static Comparator<E> n...
ComparatorUtils { @SuppressWarnings("unchecked") public static <E> Comparator<E> nullHighComparator(Comparator<E> comparator) { if (comparator == null) { comparator = NATURAL_COMPARATOR; } return new NullComparator<E>(comparator, true); } private ComparatorUtils(); @SuppressWarnings("unchecked") static Comparator<E> n...
@Test public void testUpdateReturnGeneratedIdLong() throws Exception { TypeToken<User> pt = TypeToken.of(User.class); TypeToken<Long> rt = TypeToken.of(long.class); String srcSql = "insert into user(id, name) values(:1.id, :1.name)"; AbstractOperator operator = getOperatorReturnGeneratedId(pt, rt, srcSql); operator.set...
@Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
@Test public void testAsIterable() { final List<Integer> list = new ArrayList<Integer>(); list.add(Integer.valueOf(0)); list.add(Integer.valueOf(1)); list.add(Integer.valueOf(2)); final Iterator<Integer> iterator = list.iterator(); final Iterable<Integer> iterable = IteratorUtils.asIterable(iterator); int expected = 0;...
public static <E> Iterable<E> asIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, false); }
IteratorUtils { public static <E> Iterable<E> asIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, false); } }
IteratorUtils { public static <E> Iterable<E> asIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, false); } private IteratorUtils(); }
IteratorUtils { public static <E> Iterable<E> asIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, false); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static Resett...
IteratorUtils { public static <E> Iterable<E> asIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, false); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static Resett...
@Test public void testAsIterableNull() { try { IteratorUtils.asIterable(null); fail("Expecting NullPointerException"); } catch (final NullPointerException ex) { } }
public static <E> Iterable<E> asIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, false); }
IteratorUtils { public static <E> Iterable<E> asIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, false); } }
IteratorUtils { public static <E> Iterable<E> asIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, false); } private IteratorUtils(); }
IteratorUtils { public static <E> Iterable<E> asIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, false); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static Resett...
IteratorUtils { public static <E> Iterable<E> asIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, false); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static Resett...
@Test public void testAsMultipleIterable() { final List<Integer> list = new ArrayList<Integer>(); list.add(Integer.valueOf(0)); list.add(Integer.valueOf(1)); list.add(Integer.valueOf(2)); final Iterator<Integer> iterator = list.iterator(); final Iterable<Integer> iterable = IteratorUtils.asMultipleUseIterable(iterator)...
public static <E> Iterable<E> asMultipleUseIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, true); }
IteratorUtils { public static <E> Iterable<E> asMultipleUseIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, true); } }
IteratorUtils { public static <E> Iterable<E> asMultipleUseIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, true); } private IteratorUtils(); }
IteratorUtils { public static <E> Iterable<E> asMultipleUseIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, true); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); sta...
IteratorUtils { public static <E> Iterable<E> asMultipleUseIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, true); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); sta...
@Test public void testAsMultipleIterableNull() { try { IteratorUtils.asMultipleUseIterable(null); fail("Expecting NullPointerException"); } catch (final NullPointerException ex) { } }
public static <E> Iterable<E> asMultipleUseIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, true); }
IteratorUtils { public static <E> Iterable<E> asMultipleUseIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, true); } }
IteratorUtils { public static <E> Iterable<E> asMultipleUseIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, true); } private IteratorUtils(); }
IteratorUtils { public static <E> Iterable<E> asMultipleUseIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, true); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); sta...
IteratorUtils { public static <E> Iterable<E> asMultipleUseIterable(final Iterator<? extends E> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } return new IteratorIterable<E>(iterator, true); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); sta...
@Test public void testToList() { final List<Object> list = new ArrayList<Object>(); list.add(Integer.valueOf(1)); list.add("Two"); list.add(null); final List<Object> result = IteratorUtils.toList(list.iterator()); assertEquals(list, result); }
public static <E> List<E> toList(final Iterator<? extends E> iterator) { return toList(iterator, 10); }
IteratorUtils { public static <E> List<E> toList(final Iterator<? extends E> iterator) { return toList(iterator, 10); } }
IteratorUtils { public static <E> List<E> toList(final Iterator<? extends E> iterator) { return toList(iterator, 10); } private IteratorUtils(); }
IteratorUtils { public static <E> List<E> toList(final Iterator<? extends E> iterator) { return toList(iterator, 10); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator(); static MapIterator<K, V>...
IteratorUtils { public static <E> List<E> toList(final Iterator<? extends E> iterator) { return toList(iterator, 10); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator(); static MapIterator<K, V>...
@Test public void testToArray() { final List<Object> list = new ArrayList<Object>(); list.add(Integer.valueOf(1)); list.add("Two"); list.add(null); final Object[] result = IteratorUtils.toArray(list.iterator()); assertEquals(list, Arrays.asList(result)); }
public static Object[] toArray(final Iterator<?> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } final List<?> list = toList(iterator, 100); return list.toArray(); }
IteratorUtils { public static Object[] toArray(final Iterator<?> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } final List<?> list = toList(iterator, 100); return list.toArray(); } }
IteratorUtils { public static Object[] toArray(final Iterator<?> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } final List<?> list = toList(iterator, 100); return list.toArray(); } private IteratorUtils(); }
IteratorUtils { public static Object[] toArray(final Iterator<?> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } final List<?> list = toList(iterator, 100); return list.toArray(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static Resettab...
IteratorUtils { public static Object[] toArray(final Iterator<?> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } final List<?> list = toList(iterator, 100); return list.toArray(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static Resettab...
@Test public void testToArray2() { final List<String> list = new ArrayList<String>(); list.add("One"); list.add("Two"); list.add(null); final String[] result = IteratorUtils.toArray(list.iterator(), String.class); assertEquals(list, Arrays.asList(result)); }
public static Object[] toArray(final Iterator<?> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } final List<?> list = toList(iterator, 100); return list.toArray(); }
IteratorUtils { public static Object[] toArray(final Iterator<?> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } final List<?> list = toList(iterator, 100); return list.toArray(); } }
IteratorUtils { public static Object[] toArray(final Iterator<?> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } final List<?> list = toList(iterator, 100); return list.toArray(); } private IteratorUtils(); }
IteratorUtils { public static Object[] toArray(final Iterator<?> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } final List<?> list = toList(iterator, 100); return list.toArray(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static Resettab...
IteratorUtils { public static Object[] toArray(final Iterator<?> iterator) { if (iterator == null) { throw new NullPointerException("Iterator must not be null"); } final List<?> list = toList(iterator, 100); return list.toArray(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static Resettab...
@Test public void testArrayIterator() { final Object[] objArray = {"a", "b", "c"}; ResettableIterator<Object> iterator = IteratorUtils.arrayIterator(objArray); assertTrue(iterator.next().equals("a")); assertTrue(iterator.next().equals("b")); iterator.reset(); assertTrue(iterator.next().equals("a")); try { iterator = It...
public static <E> ResettableIterator<E> arrayIterator(final E... array) { return new ObjectArrayIterator<E>(array); }
IteratorUtils { public static <E> ResettableIterator<E> arrayIterator(final E... array) { return new ObjectArrayIterator<E>(array); } }
IteratorUtils { public static <E> ResettableIterator<E> arrayIterator(final E... array) { return new ObjectArrayIterator<E>(array); } private IteratorUtils(); }
IteratorUtils { public static <E> ResettableIterator<E> arrayIterator(final E... array) { return new ObjectArrayIterator<E>(array); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator(); static Map...
IteratorUtils { public static <E> ResettableIterator<E> arrayIterator(final E... array) { return new ObjectArrayIterator<E>(array); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator(); static Map...
@Test public void testArrayListIterator() { final Object[] objArray = {"a", "b", "c", "d"}; ResettableListIterator<Object> iterator = IteratorUtils.arrayListIterator(objArray); assertTrue(!iterator.hasPrevious()); assertTrue(iterator.previousIndex() == -1); assertTrue(iterator.nextIndex() == 0); assertTrue(iterator.nex...
public static <E> ResettableListIterator<E> arrayListIterator(final E... array) { return new ObjectArrayListIterator<E>(array); }
IteratorUtils { public static <E> ResettableListIterator<E> arrayListIterator(final E... array) { return new ObjectArrayListIterator<E>(array); } }
IteratorUtils { public static <E> ResettableListIterator<E> arrayListIterator(final E... array) { return new ObjectArrayListIterator<E>(array); } private IteratorUtils(); }
IteratorUtils { public static <E> ResettableListIterator<E> arrayListIterator(final E... array) { return new ObjectArrayListIterator<E>(array); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator()...
IteratorUtils { public static <E> ResettableListIterator<E> arrayListIterator(final E... array) { return new ObjectArrayListIterator<E>(array); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator()...
@Test public void testEmptyIterator() { assertSame(EmptyIterator.INSTANCE, IteratorUtils.EMPTY_ITERATOR); assertSame(EmptyIterator.RESETTABLE_INSTANCE, IteratorUtils.EMPTY_ITERATOR); assertEquals(true, IteratorUtils.EMPTY_ITERATOR instanceof Iterator); assertEquals(true, IteratorUtils.EMPTY_ITERATOR instanceof Resettab...
public static <E> ResettableIterator<E> emptyIterator() { return EmptyIterator.<E>resettableEmptyIterator(); }
IteratorUtils { public static <E> ResettableIterator<E> emptyIterator() { return EmptyIterator.<E>resettableEmptyIterator(); } }
IteratorUtils { public static <E> ResettableIterator<E> emptyIterator() { return EmptyIterator.<E>resettableEmptyIterator(); } private IteratorUtils(); }
IteratorUtils { public static <E> ResettableIterator<E> emptyIterator() { return EmptyIterator.<E>resettableEmptyIterator(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator(); static MapIterato...
IteratorUtils { public static <E> ResettableIterator<E> emptyIterator() { return EmptyIterator.<E>resettableEmptyIterator(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator(); static MapIterato...
@Test public void testStatsCounter() throws Exception { TypeToken<User> pt = TypeToken.of(User.class); TypeToken<Integer> rt = TypeToken.of(int.class); String srcSql = "update user set name=:1.name where id=:1.id"; AbstractOperator operator = getOperator(pt, rt, srcSql); operator.setJdbcOperations(new JdbcOperationsAda...
@Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
@Test public void testEmptyListIterator() { assertSame(EmptyListIterator.INSTANCE, IteratorUtils.EMPTY_LIST_ITERATOR); assertSame(EmptyListIterator.RESETTABLE_INSTANCE, IteratorUtils.EMPTY_LIST_ITERATOR); assertEquals(true, IteratorUtils.EMPTY_LIST_ITERATOR instanceof Iterator); assertEquals(true, IteratorUtils.EMPTY_L...
public static <E> ResettableListIterator<E> emptyListIterator() { return EmptyListIterator.<E>resettableEmptyListIterator(); }
IteratorUtils { public static <E> ResettableListIterator<E> emptyListIterator() { return EmptyListIterator.<E>resettableEmptyListIterator(); } }
IteratorUtils { public static <E> ResettableListIterator<E> emptyListIterator() { return EmptyListIterator.<E>resettableEmptyListIterator(); } private IteratorUtils(); }
IteratorUtils { public static <E> ResettableListIterator<E> emptyListIterator() { return EmptyListIterator.<E>resettableEmptyListIterator(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator(); s...
IteratorUtils { public static <E> ResettableListIterator<E> emptyListIterator() { return EmptyListIterator.<E>resettableEmptyListIterator(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator(); s...
@Test @SuppressWarnings("unchecked") public void testEmptyMapIterator() { assertSame(EmptyMapIterator.INSTANCE, IteratorUtils.EMPTY_MAP_ITERATOR); assertEquals(true, IteratorUtils.EMPTY_MAP_ITERATOR instanceof Iterator); assertEquals(true, IteratorUtils.EMPTY_MAP_ITERATOR instanceof MapIterator); assertEquals(true, Ite...
public static <K, V> MapIterator<K, V> emptyMapIterator() { return EmptyMapIterator.<K, V>emptyMapIterator(); }
IteratorUtils { public static <K, V> MapIterator<K, V> emptyMapIterator() { return EmptyMapIterator.<K, V>emptyMapIterator(); } }
IteratorUtils { public static <K, V> MapIterator<K, V> emptyMapIterator() { return EmptyMapIterator.<K, V>emptyMapIterator(); } private IteratorUtils(); }
IteratorUtils { public static <K, V> MapIterator<K, V> emptyMapIterator() { return EmptyMapIterator.<K, V>emptyMapIterator(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator(); static MapIterat...
IteratorUtils { public static <K, V> MapIterator<K, V> emptyMapIterator() { return EmptyMapIterator.<K, V>emptyMapIterator(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator(); static MapIterat...
@Test @SuppressWarnings("unchecked") public void testEmptyOrderedIterator() { assertSame(EmptyOrderedIterator.INSTANCE, IteratorUtils.EMPTY_ORDERED_ITERATOR); assertEquals(true, IteratorUtils.EMPTY_ORDERED_ITERATOR instanceof Iterator); assertEquals(true, IteratorUtils.EMPTY_ORDERED_ITERATOR instanceof OrderedIterator)...
public static <E> OrderedIterator<E> emptyOrderedIterator() { return EmptyOrderedIterator.<E>emptyOrderedIterator(); }
IteratorUtils { public static <E> OrderedIterator<E> emptyOrderedIterator() { return EmptyOrderedIterator.<E>emptyOrderedIterator(); } }
IteratorUtils { public static <E> OrderedIterator<E> emptyOrderedIterator() { return EmptyOrderedIterator.<E>emptyOrderedIterator(); } private IteratorUtils(); }
IteratorUtils { public static <E> OrderedIterator<E> emptyOrderedIterator() { return EmptyOrderedIterator.<E>emptyOrderedIterator(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator(); static Ma...
IteratorUtils { public static <E> OrderedIterator<E> emptyOrderedIterator() { return EmptyOrderedIterator.<E>emptyOrderedIterator(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrderedIterator(); static Ma...
@Test @SuppressWarnings("unchecked") public void testEmptyOrderedMapIterator() { assertSame(EmptyOrderedMapIterator.INSTANCE, IteratorUtils.EMPTY_ORDERED_MAP_ITERATOR); assertEquals(true, IteratorUtils.EMPTY_ORDERED_MAP_ITERATOR instanceof Iterator); assertEquals(true, IteratorUtils.EMPTY_ORDERED_MAP_ITERATOR instanceo...
public static <K, V> OrderedMapIterator<K, V> emptyOrderedMapIterator() { return EmptyOrderedMapIterator.<K, V>emptyOrderedMapIterator(); }
IteratorUtils { public static <K, V> OrderedMapIterator<K, V> emptyOrderedMapIterator() { return EmptyOrderedMapIterator.<K, V>emptyOrderedMapIterator(); } }
IteratorUtils { public static <K, V> OrderedMapIterator<K, V> emptyOrderedMapIterator() { return EmptyOrderedMapIterator.<K, V>emptyOrderedMapIterator(); } private IteratorUtils(); }
IteratorUtils { public static <K, V> OrderedMapIterator<K, V> emptyOrderedMapIterator() { return EmptyOrderedMapIterator.<K, V>emptyOrderedMapIterator(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrdered...
IteratorUtils { public static <K, V> OrderedMapIterator<K, V> emptyOrderedMapIterator() { return EmptyOrderedMapIterator.<K, V>emptyOrderedMapIterator(); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator<E> emptyListIterator(); static OrderedIterator<E> emptyOrdered...
@Test public void testNodeListIterator() { final Node[] nodes = createNodes(); final NodeList nodeList = createNodeList(nodes); final Iterator<Node> iterator = IteratorUtils.nodeListIterator(nodeList); int expectedNodeIndex = 0; for (final Node actual : IteratorUtils.asIterable(iterator)) { assertEquals(nodes[expectedN...
public static NodeListIterator nodeListIterator(final NodeList nodeList) { if (nodeList == null) { throw new NullPointerException("NodeList must not be null"); } return new NodeListIterator(nodeList); }
IteratorUtils { public static NodeListIterator nodeListIterator(final NodeList nodeList) { if (nodeList == null) { throw new NullPointerException("NodeList must not be null"); } return new NodeListIterator(nodeList); } }
IteratorUtils { public static NodeListIterator nodeListIterator(final NodeList nodeList) { if (nodeList == null) { throw new NullPointerException("NodeList must not be null"); } return new NodeListIterator(nodeList); } private IteratorUtils(); }
IteratorUtils { public static NodeListIterator nodeListIterator(final NodeList nodeList) { if (nodeList == null) { throw new NullPointerException("NodeList must not be null"); } return new NodeListIterator(nodeList); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator...
IteratorUtils { public static NodeListIterator nodeListIterator(final NodeList nodeList) { if (nodeList == null) { throw new NullPointerException("NodeList must not be null"); } return new NodeListIterator(nodeList); } private IteratorUtils(); static ResettableIterator<E> emptyIterator(); static ResettableListIterator...
@Test public void testCollatedIterator() { try { IteratorUtils.collatedIterator(null, collectionOdd.iterator(), null); fail("expecting NullPointerException"); } catch (NullPointerException npe) { } try { IteratorUtils.collatedIterator(null, null, collectionEven.iterator()); fail("expecting NullPointerException"); } cat...
public static <E> Iterator<E> collatedIterator(final Comparator<? super E> comparator, final Iterator<? extends E> iterator1, final Iterator<? extends E> iterator2) { @SuppressWarnings("unchecked") final Comparator<E> comp = comparator == null ? ComparatorUtils.NATURAL_COMPARATOR : (Comparator<E>) comparator; return ne...
IteratorUtils { public static <E> Iterator<E> collatedIterator(final Comparator<? super E> comparator, final Iterator<? extends E> iterator1, final Iterator<? extends E> iterator2) { @SuppressWarnings("unchecked") final Comparator<E> comp = comparator == null ? ComparatorUtils.NATURAL_COMPARATOR : (Comparator<E>) compa...
IteratorUtils { public static <E> Iterator<E> collatedIterator(final Comparator<? super E> comparator, final Iterator<? extends E> iterator1, final Iterator<? extends E> iterator2) { @SuppressWarnings("unchecked") final Comparator<E> comp = comparator == null ? ComparatorUtils.NATURAL_COMPARATOR : (Comparator<E>) compa...
IteratorUtils { public static <E> Iterator<E> collatedIterator(final Comparator<? super E> comparator, final Iterator<? extends E> iterator1, final Iterator<? extends E> iterator2) { @SuppressWarnings("unchecked") final Comparator<E> comp = comparator == null ? ComparatorUtils.NATURAL_COMPARATOR : (Comparator<E>) compa...
IteratorUtils { public static <E> Iterator<E> collatedIterator(final Comparator<? super E> comparator, final Iterator<? extends E> iterator1, final Iterator<? extends E> iterator2) { @SuppressWarnings("unchecked") final Comparator<E> comp = comparator == null ? ComparatorUtils.NATURAL_COMPARATOR : (Comparator<E>) compa...
@Test public void forEach() { final List<Integer> listA = new ArrayList<Integer>(); listA.add(1); final List<Integer> listB = new ArrayList<Integer>(); listB.add(2); final Closure<List<Integer>> testClosure = ClosureUtils.invokerClosure("clear"); final Collection<List<Integer>> col = new ArrayList<List<Integer>>(); col...
public static <E> void forEach(final Iterator<E> iterator, final Closure<? super E> closure) { if (closure == null) { throw new NullPointerException("Closure must not be null"); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); closure.execute(element); } } }
IteratorUtils { public static <E> void forEach(final Iterator<E> iterator, final Closure<? super E> closure) { if (closure == null) { throw new NullPointerException("Closure must not be null"); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); closure.execute(element); } } } }
IteratorUtils { public static <E> void forEach(final Iterator<E> iterator, final Closure<? super E> closure) { if (closure == null) { throw new NullPointerException("Closure must not be null"); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); closure.execute(element); } } } priv...
IteratorUtils { public static <E> void forEach(final Iterator<E> iterator, final Closure<? super E> closure) { if (closure == null) { throw new NullPointerException("Closure must not be null"); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); closure.execute(element); } } } priv...
IteratorUtils { public static <E> void forEach(final Iterator<E> iterator, final Closure<? super E> closure) { if (closure == null) { throw new NullPointerException("Closure must not be null"); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); closure.execute(element); } } } priv...
@Test public void forEachButLast() { final List<Integer> listA = new ArrayList<Integer>(); listA.add(1); final List<Integer> listB = new ArrayList<Integer>(); listB.add(2); final Closure<List<Integer>> testClosure = ClosureUtils.invokerClosure("clear"); final Collection<List<Integer>> col = new ArrayList<List<Integer>>...
public static <E> E forEachButLast(final Iterator<E> iterator, final Closure<? super E> closure) { if (closure == null) { throw new NullPointerException("Closure must not be null."); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); if (iterator.hasNext()) { closure.execute(eleme...
IteratorUtils { public static <E> E forEachButLast(final Iterator<E> iterator, final Closure<? super E> closure) { if (closure == null) { throw new NullPointerException("Closure must not be null."); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); if (iterator.hasNext()) { closu...
IteratorUtils { public static <E> E forEachButLast(final Iterator<E> iterator, final Closure<? super E> closure) { if (closure == null) { throw new NullPointerException("Closure must not be null."); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); if (iterator.hasNext()) { closu...
IteratorUtils { public static <E> E forEachButLast(final Iterator<E> iterator, final Closure<? super E> closure) { if (closure == null) { throw new NullPointerException("Closure must not be null."); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); if (iterator.hasNext()) { closu...
IteratorUtils { public static <E> E forEachButLast(final Iterator<E> iterator, final Closure<? super E> closure) { if (closure == null) { throw new NullPointerException("Closure must not be null."); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); if (iterator.hasNext()) { closu...
@Test public void find() { Predicate<Number> testPredicate = equalPredicate((Number) 4); Integer test = IteratorUtils.find(iterableA.iterator(), testPredicate); assertTrue(test.equals(4)); testPredicate = equalPredicate((Number) 45); test = IteratorUtils.find(iterableA.iterator(), testPredicate); assertTrue(test == nul...
public static <E> E find(final Iterator<E> iterator, final Predicate<? super E> predicate) { if (predicate == null) { throw new NullPointerException("Predicate must not be null"); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); if (predicate.evaluate(element)) { return element;...
IteratorUtils { public static <E> E find(final Iterator<E> iterator, final Predicate<? super E> predicate) { if (predicate == null) { throw new NullPointerException("Predicate must not be null"); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); if (predicate.evaluate(element)) {...
IteratorUtils { public static <E> E find(final Iterator<E> iterator, final Predicate<? super E> predicate) { if (predicate == null) { throw new NullPointerException("Predicate must not be null"); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); if (predicate.evaluate(element)) {...
IteratorUtils { public static <E> E find(final Iterator<E> iterator, final Predicate<? super E> predicate) { if (predicate == null) { throw new NullPointerException("Predicate must not be null"); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); if (predicate.evaluate(element)) {...
IteratorUtils { public static <E> E find(final Iterator<E> iterator, final Predicate<? super E> predicate) { if (predicate == null) { throw new NullPointerException("Predicate must not be null"); } if (iterator != null) { while (iterator.hasNext()) { final E element = iterator.next(); if (predicate.evaluate(element)) {...
@Test public void indexOf() { Predicate<Number> testPredicate = equalPredicate((Number) 4); int index = IteratorUtils.indexOf(iterableA.iterator(), testPredicate); assertEquals(6, index); testPredicate = equalPredicate((Number) 45); index = IteratorUtils.indexOf(iterableA.iterator(), testPredicate); assertEquals(-1, in...
public static <E> int indexOf(final Iterator<E> iterator, final Predicate<? super E> predicate) { if (predicate == null) { throw new NullPointerException("Predicate must not be null"); } if (iterator != null) { for(int index = 0; iterator.hasNext(); index++) { final E element = iterator.next(); if (predicate.evaluate(e...
IteratorUtils { public static <E> int indexOf(final Iterator<E> iterator, final Predicate<? super E> predicate) { if (predicate == null) { throw new NullPointerException("Predicate must not be null"); } if (iterator != null) { for(int index = 0; iterator.hasNext(); index++) { final E element = iterator.next(); if (pred...
IteratorUtils { public static <E> int indexOf(final Iterator<E> iterator, final Predicate<? super E> predicate) { if (predicate == null) { throw new NullPointerException("Predicate must not be null"); } if (iterator != null) { for(int index = 0; iterator.hasNext(); index++) { final E element = iterator.next(); if (pred...
IteratorUtils { public static <E> int indexOf(final Iterator<E> iterator, final Predicate<? super E> predicate) { if (predicate == null) { throw new NullPointerException("Predicate must not be null"); } if (iterator != null) { for(int index = 0; iterator.hasNext(); index++) { final E element = iterator.next(); if (pred...
IteratorUtils { public static <E> int indexOf(final Iterator<E> iterator, final Predicate<? super E> predicate) { if (predicate == null) { throw new NullPointerException("Predicate must not be null"); } if (iterator != null) { for(int index = 0; iterator.hasNext(); index++) { final E element = iterator.next(); if (pred...
@Test public void testUpdateReturnTypeError() throws Exception { thrown.expect(DescriptionException.class); thrown.expectMessage("the return type of update expected one of [void, int, long, boolean, " + "Void, Integer, Long, Boolean] but class java.lang.String"); TypeToken<User> pt = TypeToken.of(User.class); TypeToken...
@Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
@Test public void getFromIterator() throws Exception { Iterator<Integer> iterator = iterableA.iterator(); assertEquals(1, (int) IteratorUtils.get(iterator, 0)); iterator = iterableA.iterator(); assertEquals(2, (int) IteratorUtils.get(iterator, 1)); try { IteratorUtils.get(iterator, 10); fail("Expecting IndexOutOfBounds...
public static <E> E get(final Iterator<E> iterator, final int index) { int i = index; CollectionUtils.checkIndexBounds(i); while (iterator.hasNext()) { i--; if (i == -1) { return iterator.next(); } iterator.next(); } throw new IndexOutOfBoundsException("Entry does not exist: " + i); }
IteratorUtils { public static <E> E get(final Iterator<E> iterator, final int index) { int i = index; CollectionUtils.checkIndexBounds(i); while (iterator.hasNext()) { i--; if (i == -1) { return iterator.next(); } iterator.next(); } throw new IndexOutOfBoundsException("Entry does not exist: " + i); } }
IteratorUtils { public static <E> E get(final Iterator<E> iterator, final int index) { int i = index; CollectionUtils.checkIndexBounds(i); while (iterator.hasNext()) { i--; if (i == -1) { return iterator.next(); } iterator.next(); } throw new IndexOutOfBoundsException("Entry does not exist: " + i); } private IteratorU...
IteratorUtils { public static <E> E get(final Iterator<E> iterator, final int index) { int i = index; CollectionUtils.checkIndexBounds(i); while (iterator.hasNext()) { i--; if (i == -1) { return iterator.next(); } iterator.next(); } throw new IndexOutOfBoundsException("Entry does not exist: " + i); } private IteratorU...
IteratorUtils { public static <E> E get(final Iterator<E> iterator, final int index) { int i = index; CollectionUtils.checkIndexBounds(i); while (iterator.hasNext()) { i--; if (i == -1) { return iterator.next(); } iterator.next(); } throw new IndexOutOfBoundsException("Entry does not exist: " + i); } private IteratorU...
@Test public void getCardinalityMap() { final Map<Number, Integer> freqA = CollectionUtils.<Number>getCardinalityMap(iterableA); assertEquals(1, (int) freqA.get(1)); assertEquals(2, (int) freqA.get(2)); assertEquals(3, (int) freqA.get(3)); assertEquals(4, (int) freqA.get(4)); assertNull(freqA.get(5)); final Map<Long, I...
public static <O> Map<O, Integer> getCardinalityMap(final Iterable<? extends O> coll) { final Map<O, Integer> count = new HashMap<O, Integer>(); for (final O obj : coll) { final Integer c = count.get(obj); if (c == null) { count.put(obj, Integer.valueOf(1)); } else { count.put(obj, Integer.valueOf(c.intValue() + 1)); }...
CollectionUtils { public static <O> Map<O, Integer> getCardinalityMap(final Iterable<? extends O> coll) { final Map<O, Integer> count = new HashMap<O, Integer>(); for (final O obj : coll) { final Integer c = count.get(obj); if (c == null) { count.put(obj, Integer.valueOf(1)); } else { count.put(obj, Integer.valueOf(c.i...
CollectionUtils { public static <O> Map<O, Integer> getCardinalityMap(final Iterable<? extends O> coll) { final Map<O, Integer> count = new HashMap<O, Integer>(); for (final O obj : coll) { final Integer c = count.get(obj); if (c == null) { count.put(obj, Integer.valueOf(1)); } else { count.put(obj, Integer.valueOf(c.i...
CollectionUtils { public static <O> Map<O, Integer> getCardinalityMap(final Iterable<? extends O> coll) { final Map<O, Integer> count = new HashMap<O, Integer>(); for (final O obj : coll) { final Integer c = count.get(obj); if (c == null) { count.put(obj, Integer.valueOf(1)); } else { count.put(obj, Integer.valueOf(c.i...
CollectionUtils { public static <O> Map<O, Integer> getCardinalityMap(final Iterable<? extends O> coll) { final Map<O, Integer> count = new HashMap<O, Integer>(); for (final O obj : coll) { final Integer c = count.get(obj); if (c == null) { count.put(obj, Integer.valueOf(1)); } else { count.put(obj, Integer.valueOf(c.i...
@Test @Deprecated public void cardinality() { assertEquals(1, CollectionUtils.cardinality(1, iterableA)); assertEquals(2, CollectionUtils.cardinality(2, iterableA)); assertEquals(3, CollectionUtils.cardinality(3, iterableA)); assertEquals(4, CollectionUtils.cardinality(4, iterableA)); assertEquals(0, CollectionUtils.ca...
@Deprecated public static <O> int cardinality(final O obj, final Iterable<? super O> coll) { if (coll == null) { throw new NullPointerException("coll must not be null."); } return IterableUtils.frequency(coll, obj); }
CollectionUtils { @Deprecated public static <O> int cardinality(final O obj, final Iterable<? super O> coll) { if (coll == null) { throw new NullPointerException("coll must not be null."); } return IterableUtils.frequency(coll, obj); } }
CollectionUtils { @Deprecated public static <O> int cardinality(final O obj, final Iterable<? super O> coll) { if (coll == null) { throw new NullPointerException("coll must not be null."); } return IterableUtils.frequency(coll, obj); } private CollectionUtils(); }
CollectionUtils { @Deprecated public static <O> int cardinality(final O obj, final Iterable<? super O> coll) { if (coll == null) { throw new NullPointerException("coll must not be null."); } return IterableUtils.frequency(coll, obj); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection i...
CollectionUtils { @Deprecated public static <O> int cardinality(final O obj, final Iterable<? super O> coll) { if (coll == null) { throw new NullPointerException("coll must not be null."); } return IterableUtils.frequency(coll, obj); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection i...
@Test public void containsAll() { final Collection<String> empty = new ArrayList<String>(0); final Collection<String> one = new ArrayList<String>(1); one.add("1"); final Collection<String> two = new ArrayList<String>(1); two.add("2"); final Collection<String> three = new ArrayList<String>(1); three.add("3"); final Coll...
public static boolean containsAll(final Collection<?> coll1, final Collection<?> coll2) { if (coll2.isEmpty()) { return true; } else { final Iterator<?> it = coll1.iterator(); final Set<Object> elementsAlreadySeen = new HashSet<Object>(); for (final Object nextElement : coll2) { if (elementsAlreadySeen.contains(nextEle...
CollectionUtils { public static boolean containsAll(final Collection<?> coll1, final Collection<?> coll2) { if (coll2.isEmpty()) { return true; } else { final Iterator<?> it = coll1.iterator(); final Set<Object> elementsAlreadySeen = new HashSet<Object>(); for (final Object nextElement : coll2) { if (elementsAlreadySee...
CollectionUtils { public static boolean containsAll(final Collection<?> coll1, final Collection<?> coll2) { if (coll2.isEmpty()) { return true; } else { final Iterator<?> it = coll1.iterator(); final Set<Object> elementsAlreadySeen = new HashSet<Object>(); for (final Object nextElement : coll2) { if (elementsAlreadySee...
CollectionUtils { public static boolean containsAll(final Collection<?> coll1, final Collection<?> coll2) { if (coll2.isEmpty()) { return true; } else { final Iterator<?> it = coll1.iterator(); final Set<Object> elementsAlreadySeen = new HashSet<Object>(); for (final Object nextElement : coll2) { if (elementsAlreadySee...
CollectionUtils { public static boolean containsAll(final Collection<?> coll1, final Collection<?> coll2) { if (coll2.isEmpty()) { return true; } else { final Iterator<?> it = coll1.iterator(); final Set<Object> elementsAlreadySeen = new HashSet<Object>(); for (final Object nextElement : coll2) { if (elementsAlreadySee...
@Test public void containsAny() { final Collection<String> empty = new ArrayList<String>(0); final Collection<String> one = new ArrayList<String>(1); one.add("1"); final Collection<String> two = new ArrayList<String>(1); two.add("2"); final Collection<String> three = new ArrayList<String>(1); three.add("3"); final Coll...
public static boolean containsAny(final Collection<?> coll1, final Collection<?> coll2) { if (coll1.size() < coll2.size()) { for (final Object aColl1 : coll1) { if (coll2.contains(aColl1)) { return true; } } } else { for (final Object aColl2 : coll2) { if (coll1.contains(aColl2)) { return true; } } } return false; }
CollectionUtils { public static boolean containsAny(final Collection<?> coll1, final Collection<?> coll2) { if (coll1.size() < coll2.size()) { for (final Object aColl1 : coll1) { if (coll2.contains(aColl1)) { return true; } } } else { for (final Object aColl2 : coll2) { if (coll1.contains(aColl2)) { return true; } } } ...
CollectionUtils { public static boolean containsAny(final Collection<?> coll1, final Collection<?> coll2) { if (coll1.size() < coll2.size()) { for (final Object aColl1 : coll1) { if (coll2.contains(aColl1)) { return true; } } } else { for (final Object aColl2 : coll2) { if (coll1.contains(aColl2)) { return true; } } } ...
CollectionUtils { public static boolean containsAny(final Collection<?> coll1, final Collection<?> coll2) { if (coll1.size() < coll2.size()) { for (final Object aColl1 : coll1) { if (coll2.contains(aColl1)) { return true; } } } else { for (final Object aColl2 : coll2) { if (coll1.contains(aColl2)) { return true; } } } ...
CollectionUtils { public static boolean containsAny(final Collection<?> coll1, final Collection<?> coll2) { if (coll1.size() < coll2.size()) { for (final Object aColl1 : coll1) { if (coll2.contains(aColl1)) { return true; } } } else { for (final Object aColl2 : coll2) { if (coll1.contains(aColl2)) { return true; } } } ...
@Test public void union() { final Collection<Integer> col = CollectionUtils.union(iterableA, iterableC); final Map<Integer, Integer> freq = CollectionUtils.getCardinalityMap(col); assertEquals(Integer.valueOf(1), freq.get(1)); assertEquals(Integer.valueOf(4), freq.get(2)); assertEquals(Integer.valueOf(3), freq.get(3));...
public static <O> Collection<O> union(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.max(obj)); } return helper.list(); }
CollectionUtils { public static <O> Collection<O> union(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.max(obj)); } return helper.list(); } }
CollectionUtils { public static <O> Collection<O> union(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.max(obj)); } return helper.list(); } private ...
CollectionUtils { public static <O> Collection<O> union(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.max(obj)); } return helper.list(); } private ...
CollectionUtils { public static <O> Collection<O> union(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.max(obj)); } return helper.list(); } private ...
@Test public void intersection() { final Collection<Integer> col = CollectionUtils.intersection(iterableA, iterableC); final Map<Integer, Integer> freq = CollectionUtils.getCardinalityMap(col); assertNull(freq.get(1)); assertEquals(Integer.valueOf(2), freq.get(2)); assertEquals(Integer.valueOf(3), freq.get(3)); assertE...
public static <O> Collection<O> intersection(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.min(obj)); } return helper.list(); }
CollectionUtils { public static <O> Collection<O> intersection(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.min(obj)); } return helper.list(); } }
CollectionUtils { public static <O> Collection<O> intersection(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.min(obj)); } return helper.list(); } p...
CollectionUtils { public static <O> Collection<O> intersection(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.min(obj)); } return helper.list(); } p...
CollectionUtils { public static <O> Collection<O> intersection(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.min(obj)); } return helper.list(); } p...
@Test public void disjunction() { final Collection<Integer> col = CollectionUtils.disjunction(iterableA, iterableC); final Map<Integer, Integer> freq = CollectionUtils.getCardinalityMap(col); assertEquals(Integer.valueOf(1), freq.get(1)); assertEquals(Integer.valueOf(2), freq.get(2)); assertNull(freq.get(3)); assertEqu...
public static <O> Collection<O> disjunction(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.max(obj) - helper.min(obj)); } return helper.list(); }
CollectionUtils { public static <O> Collection<O> disjunction(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.max(obj) - helper.min(obj)); } return h...
CollectionUtils { public static <O> Collection<O> disjunction(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.max(obj) - helper.min(obj)); } return h...
CollectionUtils { public static <O> Collection<O> disjunction(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.max(obj) - helper.min(obj)); } return h...
CollectionUtils { public static <O> Collection<O> disjunction(final Iterable<? extends O> a, final Iterable<? extends O> b) { final SetOperationCardinalityHelper<O> helper = new SetOperationCardinalityHelper<O>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.max(obj) - helper.min(obj)); } return h...
@Test public void testSubtract() { final Collection<Integer> col = CollectionUtils.subtract(iterableA, iterableC); final Map<Integer, Integer> freq = CollectionUtils.getCardinalityMap(col); assertEquals(Integer.valueOf(1), freq.get(1)); assertNull(freq.get(2)); assertNull(freq.get(3)); assertEquals(Integer.valueOf(2), ...
public static <O> Collection<O> subtract(final Iterable<? extends O> a, final Iterable<? extends O> b) { final Predicate<O> p = TruePredicate.truePredicate(); return subtract(a, b, p); }
CollectionUtils { public static <O> Collection<O> subtract(final Iterable<? extends O> a, final Iterable<? extends O> b) { final Predicate<O> p = TruePredicate.truePredicate(); return subtract(a, b, p); } }
CollectionUtils { public static <O> Collection<O> subtract(final Iterable<? extends O> a, final Iterable<? extends O> b) { final Predicate<O> p = TruePredicate.truePredicate(); return subtract(a, b, p); } private CollectionUtils(); }
CollectionUtils { public static <O> Collection<O> subtract(final Iterable<? extends O> a, final Iterable<? extends O> b) { final Predicate<O> p = TruePredicate.truePredicate(); return subtract(a, b, p); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type stat...
CollectionUtils { public static <O> Collection<O> subtract(final Iterable<? extends O> a, final Iterable<? extends O> b) { final Predicate<O> p = TruePredicate.truePredicate(); return subtract(a, b, p); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type stat...
@Test public void testIsSubCollectionOfSelf() { assertTrue(CollectionUtils.isSubCollection(collectionA, collectionA)); assertTrue(CollectionUtils.isSubCollection(collectionB, collectionB)); }
public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; }
CollectionUtils { public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; } }
CollectionUtils { public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; } private CollectionUtils(); }
CollectionUtils { public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; } private CollectionUtils(); @Su...
CollectionUtils { public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; } private CollectionUtils(); @Su...
@Test public void testUpdateReturnGeneratedIdReturnTypeError() throws Exception { thrown.expect(DescriptionException.class); thrown.expectMessage("the return type of update(returnGeneratedId) expected " + "one of [int, long, Integer, Long] but void"); TypeToken<User> pt = TypeToken.of(User.class); TypeToken<Void> rt = ...
@Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); }
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
UpdateOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } UpdateOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object...
@Test public void testIsSubCollection() { assertTrue(!CollectionUtils.isSubCollection(collectionA, collectionC)); assertTrue(!CollectionUtils.isSubCollection(collectionC, collectionA)); }
public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; }
CollectionUtils { public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; } }
CollectionUtils { public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; } private CollectionUtils(); }
CollectionUtils { public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; } private CollectionUtils(); @Su...
CollectionUtils { public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; } private CollectionUtils(); @Su...
@Test public void testIsSubCollection2() { final Collection<Integer> c = new ArrayList<Integer>(); assertTrue(CollectionUtils.isSubCollection(c, collectionA)); assertTrue(!CollectionUtils.isSubCollection(collectionA, c)); c.add(1); assertTrue(CollectionUtils.isSubCollection(c, collectionA)); assertTrue(!CollectionUtils...
public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; }
CollectionUtils { public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; } }
CollectionUtils { public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; } private CollectionUtils(); }
CollectionUtils { public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; } private CollectionUtils(); @Su...
CollectionUtils { public static boolean isSubCollection(final Collection<?> a, final Collection<?> b) { final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; } } return true; } private CollectionUtils(); @Su...
@Test public void testIsEqualCollectionToSelf() { assertTrue(CollectionUtils.isEqualCollection(collectionA, collectionA)); assertTrue(CollectionUtils.isEqualCollection(collectionB, collectionB)); }
public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Object obj : helper.c...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
@Test public void testIsEqualCollection() { assertTrue(!CollectionUtils.isEqualCollection(collectionA, collectionC)); assertTrue(!CollectionUtils.isEqualCollection(collectionC, collectionA)); }
public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Object obj : helper.c...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
@Test public void testIsEqualCollectionReturnsFalse() { final List<Integer> b = new ArrayList<Integer>(collectionA); b.remove(1); b.add(5); assertFalse(CollectionUtils.isEqualCollection(collectionA, b)); assertFalse(CollectionUtils.isEqualCollection(b, collectionA)); }
public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Object obj : helper.c...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
@Test public void testIsEqualCollection2() { final Collection<String> a = new ArrayList<String>(); final Collection<String> b = new ArrayList<String>(); assertTrue(CollectionUtils.isEqualCollection(a, b)); assertTrue(CollectionUtils.isEqualCollection(b, a)); a.add("1"); assertTrue(!CollectionUtils.isEqualCollection(a, ...
public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Object obj : helper.c...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
@Test(expected=NullPointerException.class) public void testIsEqualCollectionNullEquator() { CollectionUtils.isEqualCollection(collectionA, collectionA, null); }
public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Object obj : helper.c...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
CollectionUtils { public static boolean isEqualCollection(final Collection<?> a, final Collection<?> b) { if(a.size() != b.size()) { return false; } final CardinalityHelper<Object> helper = new CardinalityHelper<Object>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } for( final Obj...
@Test public void testIsProperSubCollection() { final Collection<String> a = new ArrayList<String>(); final Collection<String> b = new ArrayList<String>(); assertTrue(!CollectionUtils.isProperSubCollection(a, b)); b.add("1"); assertTrue(CollectionUtils.isProperSubCollection(a, b)); assertTrue(!CollectionUtils.isProperS...
public static boolean isProperSubCollection(final Collection<?> a, final Collection<?> b) { return a.size() < b.size() && CollectionUtils.isSubCollection(a, b); }
CollectionUtils { public static boolean isProperSubCollection(final Collection<?> a, final Collection<?> b) { return a.size() < b.size() && CollectionUtils.isSubCollection(a, b); } }
CollectionUtils { public static boolean isProperSubCollection(final Collection<?> a, final Collection<?> b) { return a.size() < b.size() && CollectionUtils.isSubCollection(a, b); } private CollectionUtils(); }
CollectionUtils { public static boolean isProperSubCollection(final Collection<?> a, final Collection<?> b) { return a.size() < b.size() && CollectionUtils.isSubCollection(a, b); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCo...
CollectionUtils { public static boolean isProperSubCollection(final Collection<?> a, final Collection<?> b) { return a.size() < b.size() && CollectionUtils.isSubCollection(a, b); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCo...
@Test @Deprecated public void find() { Predicate<Number> testPredicate = equalPredicate((Number) 4); Integer test = CollectionUtils.find(collectionA, testPredicate); assertTrue(test.equals(4)); testPredicate = equalPredicate((Number) 45); test = CollectionUtils.find(collectionA, testPredicate); assertTrue(test == null)...
@Deprecated public static <T> T find(final Iterable<T> collection, final Predicate<? super T> predicate) { return predicate != null ? IterableUtils.find(collection, predicate) : null; }
CollectionUtils { @Deprecated public static <T> T find(final Iterable<T> collection, final Predicate<? super T> predicate) { return predicate != null ? IterableUtils.find(collection, predicate) : null; } }
CollectionUtils { @Deprecated public static <T> T find(final Iterable<T> collection, final Predicate<? super T> predicate) { return predicate != null ? IterableUtils.find(collection, predicate) : null; } private CollectionUtils(); }
CollectionUtils { @Deprecated public static <T> T find(final Iterable<T> collection, final Predicate<? super T> predicate) { return predicate != null ? IterableUtils.find(collection, predicate) : null; } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type stati...
CollectionUtils { @Deprecated public static <T> T find(final Iterable<T> collection, final Predicate<? super T> predicate) { return predicate != null ? IterableUtils.find(collection, predicate) : null; } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type stati...
@Test(expected = FunctorException.class) @Deprecated public void forAllDoFailure() { final Closure<String> testClosure = ClosureUtils.invokerClosure("clear"); final Collection<String> col = new ArrayList<String>(); col.add("x"); CollectionUtils.forAllDo(col, testClosure); }
@Deprecated public static <T, C extends Closure<? super T>> C forAllDo(final Iterable<T> collection, final C closure) { if (closure != null) { IterableUtils.forEach(collection, closure); } return closure; }
CollectionUtils { @Deprecated public static <T, C extends Closure<? super T>> C forAllDo(final Iterable<T> collection, final C closure) { if (closure != null) { IterableUtils.forEach(collection, closure); } return closure; } }
CollectionUtils { @Deprecated public static <T, C extends Closure<? super T>> C forAllDo(final Iterable<T> collection, final C closure) { if (closure != null) { IterableUtils.forEach(collection, closure); } return closure; } private CollectionUtils(); }
CollectionUtils { @Deprecated public static <T, C extends Closure<? super T>> C forAllDo(final Iterable<T> collection, final C closure) { if (closure != null) { IterableUtils.forEach(collection, closure); } return closure; } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatibl...
CollectionUtils { @Deprecated public static <T, C extends Closure<? super T>> C forAllDo(final Iterable<T> collection, final C closure) { if (closure != null) { IterableUtils.forEach(collection, closure); } return closure; } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatibl...
@Test public void testQueryObject() throws Exception { TypeToken<User> t = TypeToken.of(User.class); String srcSql = "select * from user where id=:1.id and name=:1.name"; AbstractOperator operator = getOperator(t, t, srcSql, new ArrayList<Annotation>()); operator.setJdbcOperations(new JdbcOperationsAdapter() { @Overrid...
@Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); }
QueryOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } }
QueryOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } QueryOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); }
QueryOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } QueryOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object e...
QueryOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } QueryOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object e...
@Test public void getFromMap() { final Map<String, String> expected = new HashMap<String, String>(); expected.put("zeroKey", "zero"); expected.put("oneKey", "one"); final Map<String, String> found = new HashMap<String, String>(); Map.Entry<String, String> entry = CollectionUtils.get(expected, 0); found.put(entry.getKey...
@Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
@Test(expected=IndexOutOfBoundsException.class) public void getFromList() throws Exception { final List<String> list = createMock(List.class); expect(list.get(0)).andReturn("zero"); expect(list.get(1)).andReturn("one"); replay(); final String string = CollectionUtils.get(list, 0); assertEquals("zero", string); assertEq...
@Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
@Test @Deprecated public void getFromIterator() throws Exception { Iterator<Integer> iterator = iterableA.iterator(); assertEquals(1, (int) CollectionUtils.get(iterator, 0)); iterator = iterableA.iterator(); assertEquals(2, (int) CollectionUtils.get(iterator, 1)); try { CollectionUtils.get(iterator, 10); fail("Expectin...
@Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
@Test @Deprecated public void getFromEnumeration() throws Exception { final Vector<String> vector = new Vector<String>(); vector.addElement("zero"); vector.addElement("one"); Enumeration<String> en = vector.elements(); assertEquals("zero", CollectionUtils.get(en, 0)); en = vector.elements(); assertEquals("one", Collect...
@Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
@Test(expected = IndexOutOfBoundsException.class) @Deprecated public void getFromIterable() throws Exception { final Bag<String> bag = new HashBag<String>(); bag.add("element", 1); assertEquals("element", CollectionUtils.get(bag, 0)); CollectionUtils.get(bag, 1); }
@Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
@Test(expected = IndexOutOfBoundsException.class) public void getFromObjectArray() throws Exception { final Object[] objArray = new Object[2]; objArray[0] = "zero"; objArray[1] = "one"; assertEquals("zero", CollectionUtils.get(objArray, 0)); assertEquals("one", CollectionUtils.get(objArray, 1)); CollectionUtils.get(obj...
@Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
@Test(expected = IndexOutOfBoundsException.class) public void getFromPrimitiveArray() throws Exception { final int[] array = new int[2]; array[0] = 10; array[1] = 20; assertEquals(10, CollectionUtils.get(array, 0)); assertEquals(20, CollectionUtils.get(array, 1)); CollectionUtils.get(array, 2); }
@Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
@Test(expected=IllegalArgumentException.class) public void getFromObject() throws Exception { final Object obj = new Object(); CollectionUtils.get(obj, 0); }
@Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); }
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
CollectionUtils { @Deprecated public static <T> T get(final Iterator<T> iterator, final int index) { return IteratorUtils.get(iterator, index); } private CollectionUtils(); @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type static Collection<T> emptyCollection(); @SuppressWarnings("unch...
@Test public void testSize_List() { List<String> list = null; assertEquals(0, CollectionUtils.size(list)); list = new ArrayList<String>(); assertEquals(0, CollectionUtils.size(list)); list.add("a"); assertEquals(1, CollectionUtils.size(list)); list.add("b"); assertEquals(2, CollectionUtils.size(list)); }
public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total = IterableUtils.s...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
@Test public void testSize_Map() { final Map<String, String> map = new HashMap<String, String>(); assertEquals(0, CollectionUtils.size(map)); map.put("1", "a"); assertEquals(1, CollectionUtils.size(map)); map.put("2", "b"); assertEquals(2, CollectionUtils.size(map)); }
public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total = IterableUtils.s...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
@Test public void testQueryList() throws Exception { TypeToken<User> pt = TypeToken.of(User.class); TypeToken<List<User>> rt = new TypeToken<List<User>>() { }; String srcSql = "select * from user where id=:1.id and name=:1.name"; AbstractOperator operator = getOperator(pt, rt, srcSql, new ArrayList<Annotation>()); oper...
@Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); }
QueryOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } }
QueryOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } QueryOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); }
QueryOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } QueryOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object e...
QueryOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } QueryOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object e...
@Test public void testSize_Array() { final Object[] objectArray = new Object[0]; assertEquals(0, CollectionUtils.size(objectArray)); final String[] stringArray = new String[3]; assertEquals(3, CollectionUtils.size(stringArray)); stringArray[0] = "a"; stringArray[1] = "b"; stringArray[2] = "c"; assertEquals(3, Collectio...
public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total = IterableUtils.s...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
@Test public void testSize_PrimitiveArray() { final int[] intArray = new int[0]; assertEquals(0, CollectionUtils.size(intArray)); final double[] doubleArray = new double[3]; assertEquals(3, CollectionUtils.size(doubleArray)); doubleArray[0] = 0.0d; doubleArray[1] = 1.0d; doubleArray[2] = 2.5d; assertEquals(3, Collectio...
public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total = IterableUtils.s...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
@Test public void testSize_Enumeration() { final Vector<String> list = new Vector<String>(); assertEquals(0, CollectionUtils.size(list.elements())); list.add("a"); assertEquals(1, CollectionUtils.size(list.elements())); list.add("b"); assertEquals(2, CollectionUtils.size(list.elements())); }
public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total = IterableUtils.s...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
@Test public void testSize_Iterator() { final List<String> list = new ArrayList<String>(); assertEquals(0, CollectionUtils.size(list.iterator())); list.add("a"); assertEquals(1, CollectionUtils.size(list.iterator())); list.add("b"); assertEquals(2, CollectionUtils.size(list.iterator())); }
public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total = IterableUtils.s...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
@Test(expected=IllegalArgumentException.class) public void testSize_Other() { CollectionUtils.size("not a list"); }
public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total = IterableUtils.s...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...
CollectionUtils { public static int size(final Object object) { if (object == null) { return 0; } int total = 0; if (object instanceof Map<?,?>) { total = ((Map<?, ?>) object).size(); } else if (object instanceof Collection<?>) { total = ((Collection<?>) object).size(); } else if (object instanceof Iterable<?>) { total...