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.
PollableFuture::pollNow
added.PollableCompletableFuture
extracted fromPollableFuture
, is now a subclass ofCompletableFuture
.PollableFuture::DelegatingPollableFuture
refactored.
ArrayListSequence
added tocollection
package.Sequences.areEqual()
andSequences.upCast()
added.
ByteArrayBuilder
,ByteArrayConsumer
, andByteArrayFunction
added toutil
package.DevNullOutputStream
andPassThroughOutputStream
added to newio
package.
- Primitive specializations of
Sequence
added. PrimitiveIterators
factory class forjava.util.PrimitiveIterator
implementations added.AlphaCodes
andNothing
added toutil
package.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 falseNullPointerException
warnings.
GetByteAtFunction
,PutByteAtFunction
, andUtf8
added toutil
package.
PollableFuture
added toconcurrent
package.GetCharAtFunction
,PutCharAtFunction
, andTimeSource
added toutil
package.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
.Sequence
implementsIterable
.- 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
.