Skip to content

Commit

Permalink
reinstate Tuple.singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
esaulpaugh committed Sep 19, 2024
1 parent 7a7bcbd commit c4fa654
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/esaulpaugh/headlong/abi/Tuple.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ public class Tuple implements Iterable<Object> {
this.elements = elements;
}

/**
* @see Single#of(Object)
* @return the pair
*/
public static Tuple of() {
return Tuple.EMPTY;
}

/**
* @see Single#of(Object)
* @return the pair
* @return a tuple with one element
*/
public static <T> Single<T> singleton(T element) {
return Single.of(element);
}

public static <A, B> Pair<A, B> of(A a, B b) {
return new Pair<>(requireNoNulls(new Object[] { a, b }));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void testTupleArray() {
new Single<?>[] {
Single.of(true),
Single.of(false),
Single.of(true)
Tuple.singleton(true)
}
);

Expand Down

0 comments on commit c4fa654

Please sign in to comment.