mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Switch from Guava Optionals to Java 8 Optionals
This was a surprisingly involved change. Some of the difficulties included java.util.Optional purposely not being Serializable (so I had to move a few Optionals in mapreduce classes to @Nullable) and having to add the Truth Java8 extension library for assertion support. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=171863777
This commit is contained in:
parent
184b2b56ac
commit
c0f8da0c6e
581 changed files with 1325 additions and 932 deletions
|
@ -19,7 +19,6 @@ import static google.registry.config.ConfigUtils.makeUrl;
|
|||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Supplier;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
@ -34,6 +33,7 @@ import java.net.URI;
|
|||
import java.net.URL;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Qualifier;
|
||||
|
@ -333,13 +333,13 @@ public final class RegistryConfig {
|
|||
@Provides
|
||||
@Config("cloudDnsRootUrl")
|
||||
public static Optional<String> getCloudDnsRootUrl(RegistryConfigSettings config) {
|
||||
return Optional.fromNullable(config.cloudDns.rootUrl);
|
||||
return Optional.ofNullable(config.cloudDns.rootUrl);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Config("cloudDnsServicePath")
|
||||
public static Optional<String> getCloudDnsServicePath(RegistryConfigSettings config) {
|
||||
return Optional.fromNullable(config.cloudDns.servicePath);
|
||||
return Optional.ofNullable(config.cloudDns.servicePath);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -674,7 +674,7 @@ public final class RegistryConfig {
|
|||
@Provides
|
||||
@Config("sheetRegistrarId")
|
||||
public static Optional<String> provideSheetRegistrarId(RegistryConfigSettings config) {
|
||||
return Optional.fromNullable(config.misc.sheetExportId);
|
||||
return Optional.ofNullable(config.misc.sheetExportId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue