diff options
Diffstat (limited to 'vpp-common/vpp-translate-utils/src')
5 files changed, 11 insertions, 11 deletions
diff --git a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/AbstractInterfaceTypeCustomizer.java b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/AbstractInterfaceTypeCustomizer.java index 9227ddd32..cd3af7ec2 100644 --- a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/AbstractInterfaceTypeCustomizer.java +++ b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/AbstractInterfaceTypeCustomizer.java @@ -19,7 +19,7 @@ package io.fd.hc2vpp.common.translate.util; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.honeycomb.translate.spi.write.WriterCustomizer; import io.fd.honeycomb.translate.write.WriteContext; import io.fd.honeycomb.translate.write.WriteFailedException; diff --git a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/MultiNamingContext.java b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/MultiNamingContext.java index e093c661c..04fdb2818 100644 --- a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/MultiNamingContext.java +++ b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/MultiNamingContext.java @@ -19,7 +19,7 @@ package io.fd.hc2vpp.common.translate.util; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.honeycomb.translate.MappingContext; import io.fd.honeycomb.translate.util.RWUtils; import java.util.Collections; diff --git a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/NamingContext.java b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/NamingContext.java index b6f50b608..bbc29b622 100644 --- a/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/NamingContext.java +++ b/vpp-common/vpp-translate-utils/src/main/java/io/fd/hc2vpp/common/translate/util/NamingContext.java @@ -19,7 +19,7 @@ package io.fd.hc2vpp.common.translate.util; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.honeycomb.translate.MappingContext; import io.fd.honeycomb.translate.util.RWUtils; import java.util.List; @@ -97,7 +97,7 @@ public final class NamingContext implements AutoCloseable { @Nonnull final MappingContext mappingContext) { final Optional<Mappings> read = mappingContext.read(namingContextIid.child(Mappings.class)); if (!read.isPresent()) { - return Optional.absent(); + return Optional.empty(); } final List<Mapping> mappings = read.get().getMapping().stream() @@ -109,7 +109,7 @@ public final class NamingContext implements AutoCloseable { } else if (mappings.size() == 1) { return Optional.of(mappings.get(0).getName()); } else { - return Optional.absent(); + return Optional.empty(); } } diff --git a/vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/MultiNamingContextTest.java b/vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/MultiNamingContextTest.java index d6bd15735..bedbf8e5d 100644 --- a/vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/MultiNamingContextTest.java +++ b/vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/MultiNamingContextTest.java @@ -24,7 +24,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import com.google.common.base.Optional; +import java.util.Optional; import io.fd.honeycomb.test.tools.HoneycombTestRunner; import io.fd.honeycomb.test.tools.annotations.InjectTestData; import io.fd.honeycomb.test.tools.annotations.InjectablesProcessor; @@ -102,7 +102,7 @@ public class MultiNamingContextTest implements InjectablesProcessor { .child(MultiNaming.class, new MultiNamingKey("context")); when(mappingContext.read(multiNamingContextIid.child(Mappings.class))).thenReturn(Optional.of(mappings)); - when(mappingContext.read(parentKey(NON_EXISTING_PARENT))).thenReturn(Optional.absent()); + when(mappingContext.read(parentKey(NON_EXISTING_PARENT))).thenReturn(Optional.empty()); when(mappingContext.read(parentKey(PARENT_1))).thenReturn(Optional.of(filterForParent(PARENT_1))); when(mappingContext.read(parentKey(PARENT_2))).thenReturn(Optional.of(filterForParent(PARENT_2))); when(mappingContext.read(parentKey(PARENT_3))).thenReturn(Optional.of(filterForParent(PARENT_3))); diff --git a/vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/NamingContextTest.java b/vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/NamingContextTest.java index 9c9b0e297..93ae8c9bd 100644 --- a/vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/NamingContextTest.java +++ b/vpp-common/vpp-translate-utils/src/test/java/io/fd/hc2vpp/common/translate/util/NamingContextTest.java @@ -23,7 +23,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import com.google.common.base.Optional; +import java.util.Optional; import com.google.common.collect.Lists; import io.fd.honeycomb.test.tools.HoneycombTestRunner; import io.fd.honeycomb.test.tools.annotations.InjectTestData; @@ -110,7 +110,7 @@ public class NamingContextTest implements InjectablesProcessor { @Test public void addNameNoMapings() throws Exception { - when(mappingContext.read(namingContextIid.child(Mappings.class))).thenReturn(Optional.absent()); + when(mappingContext.read(namingContextIid.child(Mappings.class))).thenReturn(Optional.empty()); namingContext.addName("name-0", mappingContext); verify(mappingContext, times(1)) @@ -125,7 +125,7 @@ public class NamingContextTest implements InjectablesProcessor { @Test(expected = IllegalArgumentException.class) public void getAndThrow() { - when(mappingContext.read(any())).thenReturn(Optional.absent()); + when(mappingContext.read(any())).thenReturn(Optional.empty()); namingContext .getIndex("non-existing", mappingContext, () -> new IllegalArgumentException("Non existing index")); } @@ -146,7 +146,7 @@ public class NamingContextTest implements InjectablesProcessor { final Mappings mappings = new MappingsBuilder().setMapping(Lists.newArrayList(mapping1)).build(); when(mappingContext.read(namingContextIid.child(Mappings.class))).thenReturn(Optional.of(mappings)); - assertEquals(Optional.absent(), namingContext.getNameIfPresent(0, mappingContext)); + assertEquals(Optional.empty(), namingContext.getNameIfPresent(0, mappingContext)); } @Test |