summaryrefslogtreecommitdiffstats
path: root/infra/translate-api/src/main
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-11-08 10:13:36 +0100
committerMaros Marsalek <mmarsale@cisco.com>2016-11-08 13:17:57 +0100
commit757222979bc02d0aaba1870eea36413383d15bde (patch)
tree3fe2a502026fbfa9a4ae5627e1a453a057f6c1fa /infra/translate-api/src/main
parent03a638b95da83e150d4f69451c8733b5f09c37aa (diff)
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 <mmarsale@cisco.com>
Diffstat (limited to 'infra/translate-api/src/main')
-rw-r--r--infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Reader.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Reader.java b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Reader.java
index dd9944624..7138006e0 100644
--- a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Reader.java
+++ b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Reader.java
@@ -35,6 +35,21 @@ public interface Reader<D extends DataObject, B extends Builder<D>> extends Subt
// TODO HONEYCOMB-169 make async
/**
+ * Check whether the data from current reader are present or not.
+ * Invoked after {@link #readCurrentAttributes(InstanceIdentifier, Builder, ReadContext)}
+ *
+ * @param id Keyed instance identifier of read data
+ * @param built Read data as returned from builder
+ * after {@link #readCurrentAttributes(InstanceIdentifier, Builder, ReadContext)} invocation
+ * @param ctx Read context
+ *
+ *
+ * @return true if the result value is present.
+ */
+ boolean isPresent(@Nonnull InstanceIdentifier<D> id, @Nonnull D built, @Nonnull ReadContext ctx)
+ throws ReadFailedException;
+
+ /**
* Reads data identified by id
*
* @param id unique identifier of subtree to be read. The subtree must contain managed data object type. For