Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JTuples

version: 0.1.1

Helpers for working with Tuples (i.e. Map.Entry), including 2, 3, and 4 parameter tuple implementations. The purpose is to provide type inference to shorten the amount of code needed to create an entry (i.e. Tuples.of() instead of new AbstractMap.SimpleImmutableEntry()) and provide methods for mapping, copying, and comparing entries.

val t = Tuples.of("one", 2, true);
t.getValue0(); // "one"
t.getValue(2); // true
t.toString(); // ["one", 2, true]

Also includes various utility methods in Entries and Tuples:

Entries.toMutable(entry); // returns a Map.Entry with a setValue() method that does not throw an exception
Entries.binarySearch(entries, key); // searches the array of entries and returns an index (see Collections.binarySearch())
Tuples.copy(entry); // returns an immutable shallow copy of the entry

About

Tuples (i.e. Map.Entry) and helpers for creating, copying, and mapping 2, 3, and 4 parameter tuples

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages