summaryrefslogtreecommitdiffstats
path: root/v3po/translate-impl
diff options
context:
space:
mode:
Diffstat (limited to 'v3po/translate-impl')
-rw-r--r--v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeChildWriter.java6
-rw-r--r--v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeListWriter.java17
-rw-r--r--v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeRootWriter.java6
3 files changed, 12 insertions, 17 deletions
diff --git a/v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeChildWriter.java b/v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeChildWriter.java
index 54a09f272..6e0841deb 100644
--- a/v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeChildWriter.java
+++ b/v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeChildWriter.java
@@ -66,20 +66,20 @@ public class CompositeChildWriter<D extends DataObject> extends AbstractComposit
@Override
protected void writeCurrentAttributes(@Nonnull final InstanceIdentifier<D> id, @Nonnull final D data,
@Nonnull final WriteContext ctx) throws WriteFailedException {
- customizer.writeCurrentAttributes(id, data, ctx.getContext());
+ customizer.writeCurrentAttributes(id, data, ctx);
}
@Override
protected void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<D> id, @Nonnull final D dataBefore,
@Nonnull WriteContext ctx) throws WriteFailedException {
- customizer.deleteCurrentAttributes(id, dataBefore, ctx.getContext());
+ customizer.deleteCurrentAttributes(id, dataBefore, ctx);
}
@Override
protected void updateCurrentAttributes(@Nonnull final InstanceIdentifier<D> id, @Nonnull final D dataBefore,
@Nonnull final D dataAfter, @Nonnull WriteContext ctx)
throws WriteFailedException {
- customizer.updateCurrentAttributes(id, dataBefore, dataAfter, ctx.getContext());
+ customizer.updateCurrentAttributes(id, dataBefore, dataAfter, ctx);
}
@Override
diff --git a/v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeListWriter.java b/v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeListWriter.java
index 967edb6a9..1ac39b877 100644
--- a/v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeListWriter.java
+++ b/v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeListWriter.java
@@ -40,14 +40,9 @@ public class CompositeListWriter<D extends DataObject & Identifiable<K>, K exten
AbstractCompositeWriter<D>
implements ChildWriter<D> {
- public static final Function<DataObject, Object> INDEX_FUNCTION = new Function<DataObject, Object>() {
- @Override
- public Object apply(final DataObject input) {
- return input instanceof Identifiable<?>
- ? ((Identifiable<?>) input).getKey()
- : input;
- }
- };
+ public static final Function<DataObject, Object> INDEX_FUNCTION = input -> input instanceof Identifiable<?>
+ ? ((Identifiable<?>) input).getKey()
+ : input;
private final ListWriterCustomizer<D, K> customizer;
@@ -83,20 +78,20 @@ public class CompositeListWriter<D extends DataObject & Identifiable<K>, K exten
@Override
protected void writeCurrentAttributes(@Nonnull final InstanceIdentifier<D> id, @Nonnull final D data,
@Nonnull final WriteContext ctx) throws WriteFailedException {
- customizer.writeCurrentAttributes(id, data, ctx.getContext());
+ customizer.writeCurrentAttributes(id, data, ctx);
}
@Override
protected void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<D> id, @Nonnull final D dataBefore,
@Nonnull final WriteContext ctx) throws WriteFailedException {
- customizer.deleteCurrentAttributes(id, dataBefore, ctx.getContext());
+ customizer.deleteCurrentAttributes(id, dataBefore, ctx);
}
@Override
protected void updateCurrentAttributes(@Nonnull final InstanceIdentifier<D> id, @Nonnull final D dataBefore,
@Nonnull final D dataAfter, @Nonnull final WriteContext ctx)
throws WriteFailedException {
- customizer.updateCurrentAttributes(id, dataBefore, dataAfter, ctx.getContext());
+ customizer.updateCurrentAttributes(id, dataBefore, dataAfter, ctx);
}
@Override
diff --git a/v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeRootWriter.java b/v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeRootWriter.java
index 5e4ff86ad..6f46359ff 100644
--- a/v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeRootWriter.java
+++ b/v3po/translate-impl/src/main/java/io/fd/honeycomb/v3po/translate/impl/write/CompositeRootWriter.java
@@ -65,13 +65,13 @@ public class CompositeRootWriter<D extends DataObject> extends AbstractComposite
@Nonnull final WriteContext ctx) throws WriteFailedException {
// TODO wrap all customizer invocations in try catch, and wrap runtime exceptions in ReadFailed
// TODO same for readers
- customizer.writeCurrentAttributes(id, data, ctx.getContext());
+ customizer.writeCurrentAttributes(id, data, ctx);
}
@Override
protected void deleteCurrentAttributes(@Nonnull final InstanceIdentifier<D> id, @Nonnull final D dataBefore,
@Nonnull final WriteContext ctx) throws WriteFailedException {
- customizer.deleteCurrentAttributes(id, dataBefore, ctx.getContext());
+ customizer.deleteCurrentAttributes(id, dataBefore, ctx);
}
@Override
@@ -79,6 +79,6 @@ public class CompositeRootWriter<D extends DataObject> extends AbstractComposite
@Nonnull final D dataBefore,
@Nonnull final D dataAfter,
@Nonnull final WriteContext ctx) throws WriteFailedException {
- customizer.updateCurrentAttributes(id, dataBefore, dataAfter, ctx.getContext());
+ customizer.updateCurrentAttributes(id, dataBefore, dataAfter, ctx);
}
}