Once is chance; twice is coincidence; thrice is a pattern.
If you've needed a piece of code three times or more, it may be worth putting it into a library. Thrice is a collection of Java classes for which its author has found a need on three or more occasions.
BytesandDurationsadded toutilpackage.- Package
org.myire.iois now exported inmodule-info.java.
PollableFuture::pollNowadded.PollableCompletableFutureextracted fromPollableFuture, is now a subclass ofCompletableFuture.PollableFuture::DelegatingPollableFuturerefactored.
ArrayListSequenceadded tocollectionpackage.Sequences.areEqual()andSequences.upCast()added.
ByteArrayBuilder,ByteArrayConsumer, andByteArrayFunctionadded toutilpackage.DevNullOutputStreamandPassThroughOutputStreamadded to newiopackage.
- Primitive specializations of
Sequenceadded. PrimitiveIteratorsfactory class forjava.util.PrimitiveIteratorimplementations added.AlphaCodesandNothingadded toutilpackage.Numbers.requireRangeWithinBounds()added.- Methods with return values that may be null depending on the context are no longer annotated with
javax.annotation.Nullable. Some tools and IDEs no longer use that annotation in its original sense, but as an equivalent tojavax.annotation.CheckForNull, which may cause falseNullPointerExceptionwarnings.
GetByteAtFunction,PutByteAtFunction, andUtf8added toutilpackage.
PollableFutureadded toconcurrentpackage.GetCharAtFunction,PutCharAtFunction, andTimeSourceadded toutilpackage.Ascci.isAsciiHexDigit()added.Strings.bytesToCompactHexString()added.- Overloaded
Strings.asString()without default value argument added. formatInt()andformatLong()added toNumbers.- Overloaded
Numbers.requireNonNegative()for all primitive number types added. singletonIterator(),arrayIterator(), andsequenceIterator()added toIterators.SequenceimplementsIterable.- Build related tools and libraries upgraded to the latest versions.
Numbers.countDigits()added.- Build related tools and libraries upgraded to the latest versions.
- Thrice is packaged as a modular jar file. The classes in the jar file are still targeted for Java 8.
- First official release. Previous versions were semi-official and not generally available.
Thrice must be built with JDK 9 or later (but the classes are targeted for Java 8).
The command
./gradlew build
or an equivalent should do the trick.
Thrice requires Java 8 or later. The library is packaged in a modular jar file that contains the
module org.myire.thrice, which exports all packages in the project and requires no other modules.
The rest is in the JavaDocs.
Thrice can be found at Maven Central with the group ID org.myire and the artifact ID thrice.