summaryrefslogtreecommitdiffstats
path: root/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java
diff options
context:
space:
mode:
authorMaros Marsalek <mmarsale@cisco.com>2016-09-05 12:10:26 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-09-07 06:50:30 +0000
commit1326e9fa5cffe326b82aeee9d82d008526aff947 (patch)
treef8ca808f3aa3a9338573d8892b83305210a664a1 /infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java
parent6e77db8e850be8ad8a3d91bf43fb8986125ae60f (diff)
Cleanup TODOs and FIXMEs
- Fix minor ones - Report bigger and include issue number in comment - Pull common dependencies into dependency management of common/parents Change-Id: I06a6ac37c52b603fd73ed42023d6b2e7fa18010f Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java')
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java
index 695ce6806..4616f8347 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java
@@ -38,10 +38,12 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public final class RWUtils {
+ // TODO HONEYCOMB-172 update the utils methods considering Java8. Make sure they still work by wiring a detailed unit test first
+
private RWUtils() {}
/**
- * Collector expecting only a single resulting item from a stream
+ * Collector expecting only a single resulting item from a stream.
*/
public static<T> Collector<T,?,T> singleItemCollector() {
return Collectors.collectingAndThen(
@@ -56,12 +58,11 @@ public final class RWUtils {
}
/**
- * Find next item in ID after provided type
+ * Find next item in ID after provided type.
*/
@Nonnull
public static InstanceIdentifier.PathArgument getNextId(@Nonnull final InstanceIdentifier<? extends DataObject> id,
@Nonnull final InstanceIdentifier<? extends DataObject> type) {
- // TODO this is inefficient(maybe, depending on actual Iterable type)
final Iterable<InstanceIdentifier.PathArgument> pathArguments = id.getPathArguments();
final int i = Iterables.indexOf(pathArguments, new Predicate<InstanceIdentifier.PathArgument>() {
@Override
@@ -74,7 +75,7 @@ public final class RWUtils {
}
/**
- * Replace last item in ID with a provided IdentifiableItem of the same type
+ * Replace last item in ID with a provided IdentifiableItem of the same type.
*/
@SuppressWarnings("unchecked")
@Nonnull
@@ -90,7 +91,7 @@ public final class RWUtils {
}
/**
- * Create IdentifiableItem from target type of provided ID with provided key
+ * Create IdentifiableItem from target type of provided ID with provided key.
*/
@Nonnull
public static <D extends DataObject & Identifiable<K>, K extends Identifier<D>> InstanceIdentifier.IdentifiableItem<D, K> getCurrentIdItem(
@@ -99,7 +100,7 @@ public final class RWUtils {
}
/**
- * Trim InstanceIdentifier at indexOf(type)
+ * Trim InstanceIdentifier at indexOf(type).
*/
@SuppressWarnings("unchecked")
@Nonnull