Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Sloy/gallego

Repository files navigation

Gallego

Optionals for Java 7

It depends...

Someone in Galicia

Build Status Bintray

This a lightweight copy of Guava's Optional interface.

For more awesome information, check out Guava wiki on Using/avoiding null.

Basic usage

Optional<Integer> possible = Optional.of(5);
possible.isPresent(); // returns true
possible.get(); // returns 5

More info in Guava's wiki

Why?

Java 8 Optionals are nice, but some of us can't enjoy them just yet*(Android)*.

Guava Optionals are great, but it's such a big dependency to have just for the Optional interface if you don't want to be messing around with Proguard and such.

This little library lets you use Optionals without adding more code than needed.

Download

The library is available in JCenter.

Gradle:

compile 'com.sloydev:gallego:1.0.0'

Maven:

<dependency>
  <groupId>com.sloydev</groupId>
  <artifactId>gallego</artifactId>
  <version>1.0.0</version>
</dependency>

About

Lightweight Optionals for Java 7

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages