From 757222979bc02d0aaba1870eea36413383d15bde Mon Sep 17 00:00:00 2001 From: Maros Marsalek Date: Tue, 8 Nov 2016 10:13:36 +0100 Subject: HONEYCOMB-270 Add isPresent() to Readers/Customizers So that they can influence whether empty data is to be considered as present + Move registries implementations from util to impl + Introduce DelegatingReader trait + Extend GenericReader where possible to reduce duplication Change-Id: I5a416acd0c4eab1fbc30fcbe585719991dbe9215 Signed-off-by: Maros Marsalek --- .../fd/honeycomb/translate/util/read/AbstractGenericReader.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/AbstractGenericReader.java') diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/AbstractGenericReader.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/AbstractGenericReader.java index 40c78b3c9..b19b72ecf 100644 --- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/AbstractGenericReader.java +++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/AbstractGenericReader.java @@ -56,18 +56,15 @@ public abstract class AbstractGenericReader read = built.equals(emptyValue) - ? Optional.absent() - : Optional.of(built); + final Optional read = isPresent(id, built, ctx) + ? Optional.of(built) + : Optional.absent(); LOG.debug("{}: Current node read successfully. Result: {}", this, read); return read; -- cgit 1.2.3-korg