diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2018-01-08 18:08:29 +0100 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2018-01-08 18:08:33 +0100 |
commit | c990de3af0e1a5869d377829e8454dec71fc4740 (patch) | |
tree | 0566976c69baff5389c80584caac16f43402a95c /infra/translate-impl/src/main | |
parent | 6421f0dddf1ad963537f57c364198b19fcdea7c2 (diff) |
Use Comparator.comparingInt instead of lambda
Change-Id: I42372554876c27e4c5d4f053f537d6d52ff449f8
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'infra/translate-impl/src/main')
-rw-r--r-- | infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryBuilder.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryBuilder.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryBuilder.java index 8ee84b40f..64585c1af 100644 --- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryBuilder.java +++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryBuilder.java @@ -16,6 +16,8 @@ package io.fd.honeycomb.translate.impl.read.registry; +import static com.google.common.base.Preconditions.checkArgument; + import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import io.fd.honeycomb.translate.impl.read.GenericListReader; @@ -28,6 +30,13 @@ import io.fd.honeycomb.translate.read.registry.ReaderRegistry; import io.fd.honeycomb.translate.read.registry.ReaderRegistryBuilder; import io.fd.honeycomb.translate.util.AbstractSubtreeManagerRegistryBuilderBuilder; import io.fd.honeycomb.translate.util.YangDAG; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import javax.annotation.Nonnull; +import javax.annotation.concurrent.NotThreadSafe; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.Identifiable; @@ -36,15 +45,6 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; -import javax.annotation.concurrent.NotThreadSafe; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import static com.google.common.base.Preconditions.checkArgument; - @NotThreadSafe public final class CompositeReaderRegistryBuilder extends AbstractSubtreeManagerRegistryBuilderBuilder<Reader<? extends DataObject, ? extends Builder<?>>, ReaderRegistry> @@ -112,8 +112,8 @@ public final class CompositeReaderRegistryBuilder // We are violating the ordering from mappedReaders, since we are forming a composite structure // but at least order root writers - orderedRootReaders.sort((reader1, reader2) -> readerOrder.indexOf(reader1.getManagedDataObjectType()) - - readerOrder.indexOf(reader2.getManagedDataObjectType())); + orderedRootReaders.sort( + Comparator.comparingInt(reader -> readerOrder.indexOf(reader.getManagedDataObjectType()))); return new CompositeReaderRegistry(orderedRootReaders); } |