@Test(expected = IllegalArgumentException.class) public void testTupleWithNull() { Tuple.tuple("a", "b", null, "c"); }
Tuple(Object... items) { if (items == null) { this.items = Collections.emptyList(); } else { for (Object o : items) { if (o == null) { throw new IllegalArgumentException("A tuple cannot contain a `null` value"); } } this.items = Collections.unmodifiableList(Arrays.asList(items)); } }
Tuple implements Iterable<Object> { Tuple(Object... items) { if (items == null) { this.items = Collections.emptyList(); } else { for (Object o : items) { if (o == null) { throw new IllegalArgumentException("A tuple cannot contain a `null` value"); } } this.items = Collections.unmodifiableList(Arrays.asList(items)); } } }
Tuple implements Iterable<Object> { Tuple(Object... items) { if (items == null) { this.items = Collections.emptyList(); } else { for (Object o : items) { if (o == null) { throw new IllegalArgumentException("A tuple cannot contain a `null` value"); } } this.items = Collections.unmodifiableList(Arrays.asList(items)); } } Tuple(Object... items); }
Tuple implements Iterable<Object> { Tuple(Object... items) { if (items == null) { this.items = Collections.emptyList(); } else { for (Object o : items) { if (o == null) { throw new IllegalArgumentException("A tuple cannot contain a `null` value"); } } this.items = Collections.unmodifiableList(Arrays.asList(items)); } } Tuple(Object... items); static Tuple tuple(Object... items); int size(); @SuppressWarnings("unchecked") T nth(int pos); @Override Iterator<Object> iterator(); boolean contains(Object value); final boolean containsAll(Collection<?> collection); final boolean containsAll(final Object... values); final int indexOf(Object value); final int lastIndexOf(Object value); final List<Object> asList(); @Override int hashCode(); @Override boolean equals(final Object obj); }
Tuple implements Iterable<Object> { Tuple(Object... items) { if (items == null) { this.items = Collections.emptyList(); } else { for (Object o : items) { if (o == null) { throw new IllegalArgumentException("A tuple cannot contain a `null` value"); } } this.items = Collections.unmodifiableList(Arrays.asList(items)); } } Tuple(Object... items); static Tuple tuple(Object... items); int size(); @SuppressWarnings("unchecked") T nth(int pos); @Override Iterator<Object> iterator(); boolean contains(Object value); final boolean containsAll(Collection<?> collection); final boolean containsAll(final Object... values); final int indexOf(Object value); final int lastIndexOf(Object value); final List<Object> asList(); @Override int hashCode(); @Override boolean equals(final Object obj);  }