Home

Awesome

Optional – Java 8 Optional-like APIs for everyone

Android Arsenal JitPack

You get to use Optional! And you! And you there!

Differences compared to other Optional-like APIs

OptionalJava 8's OptionalGuava's OptionalOptio
Required JDK version1.71.81.61.7
Android-compatibleYesOnly for API 24 (Nougat) and upYesYes
SerializableYesNoYesNo
Support for primitive typesYes, all of them except booleanOnly for int, double, and longNoneNone
Support for functional use-casesPartiallyYes, including filter(), flatMap(), etc.NoneNone

Unique to Optional

Including Optional to your project

Include Optional to your Gradle project by adding it as a dependency in your build.gradle like so:

   repositories {
       maven { url "https://jitpack.io" }
   }
   
   dependencies {
       compile 'com.hadisatrio:Optional:v1.0.1'
   }

Contributions

Any kind of contributions will be appreciated. PR away!

License

Optional is published under the MIT license.


p.s., Please let me know if you're using Optional in your projects. Drop an email at hi[you-know-what-to-put-here]hadisatrio.com. ;)