]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Introduce utility class org.simantics.db.function.DbOptional<T>. 70/170/2
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 25 Nov 2016 10:03:27 +0000 (12:03 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 25 Nov 2016 13:49:05 +0000 (15:49 +0200)
The class is a direct copy of java.util.Optional<T> but it uses
DbConsumer, DbFunction, DbPredicate and DbSupplier instead of the
standard Java 1.8 functional interfaces to allow the DbOptional methods
to throw DatabaseExceptions for cleaner database code in certain
situations.

The rationale behind this class is much the same as with the standard
optional. See e.g.
http://www.oracle.com/technetwork/articles/java/java8-optional-2175753.html.

refs #6829

Change-Id: Ibf62a56eb227264cbfac359aca99d87570b68a47


No differences found