diff --git a/core/src/main/java/google/registry/beam/billing/BillingEvent.java b/core/src/main/java/google/registry/beam/billing/BillingEvent.java
index 6631c8d27..c8c936b58 100644
--- a/core/src/main/java/google/registry/beam/billing/BillingEvent.java
+++ b/core/src/main/java/google/registry/beam/billing/BillingEvent.java
@@ -14,7 +14,6 @@
package google.registry.beam.billing;
-import com.google.auto.value.AutoValue;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import google.registry.reporting.billing.BillingModule;
@@ -34,9 +33,39 @@ import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
-/** A POJO representing a single billable event, parsed from a {@code SchemaAndRecord}. */
-@AutoValue
-public abstract class BillingEvent {
+/**
+ * A record representing a single billable event, parsed from a {@code SchemaAndRecord}.
+ *
+ * @param id The unique ID for the {@code BillingEvent} associated with this event.
+ * @param billingTime The DateTime (in UTC) this event becomes billable.
+ * @param eventTime The DateTime (in UTC) this event was generated.
+ * @param registrarId The billed registrar's name.
+ * @param billingId The billed registrar's billing account key.
+ * @param poNumber The Purchase Order number.
+ * @param tld The TLD this event was generated for.
+ * @param action The billable action this event was generated for (CREATE, RENEW, TRANSFER...).
+ * @param domain The fully qualified domain name this event was generated for.
+ * @param repositoryId The unique RepoID associated with the billed domain.
+ * @param years The number of years this billing event is made out for.
+ * @param currency The 3-letter currency code for the billing event (USD or JPY).
+ * @param amount The total cost associated with this billing event.
+ * @param flags A list of space-delimited flags associated with the event.
+ */
+public record BillingEvent(
+ long id,
+ DateTime billingTime,
+ DateTime eventTime,
+ String registrarId,
+ String billingId,
+ String poNumber,
+ String tld,
+ String action,
+ String domain,
+ String repositoryId,
+ int years,
+ String currency,
+ double amount,
+ String flags) {
private static final DateTimeFormatter DATE_TIME_FORMATTER =
DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss zzz");
@@ -60,48 +89,6 @@ public abstract class BillingEvent {
"amount",
"flags");
- /** Returns the unique ID for the {@code BillingEvent} associated with this event. */
- abstract long id();
-
- /** Returns the UTC DateTime this event becomes billable. */
- abstract DateTime billingTime();
-
- /** Returns the UTC DateTime this event was generated. */
- abstract DateTime eventTime();
-
- /** Returns the billed registrar's name. */
- abstract String registrarId();
-
- /** Returns the billed registrar's billing account key. */
- abstract String billingId();
-
- /** Returns the Purchase Order number. */
- abstract String poNumber();
-
- /** Returns the tld this event was generated for. */
- abstract String tld();
-
- /** Returns the billable action this event was generated for (i.e., RENEW, CREATE, TRANSFER...) */
- abstract String action();
-
- /** Returns the fully qualified domain name this event was generated for. */
- abstract String domain();
-
- /** Returns the unique RepoID associated with the billed domain. */
- abstract String repositoryId();
-
- /** Returns the number of years this billing event is made out for. */
- abstract int years();
-
- /** Returns the 3-letter currency code for the billing event (i.e., USD or JPY.) */
- abstract String currency();
-
- /** Returns the cost associated with this billing event. */
- abstract double amount();
-
- /** Returns a list of space-delimited flags associated with the event. */
- abstract String flags();
-
/** Creates a concrete {@link BillingEvent}. */
static BillingEvent create(
long id,
@@ -118,7 +105,7 @@ public abstract class BillingEvent {
String currency,
double amount,
String flags) {
- return new AutoValue_BillingEvent(
+ return new BillingEvent(
id,
billingTime,
eventTime,
@@ -338,7 +325,7 @@ public abstract class BillingEvent {
@Override
public BillingEvent decode(InputStream inStream) throws IOException {
- return new AutoValue_BillingEvent(
+ return new BillingEvent(
longCoder.decode(inStream),
DATE_TIME_FORMATTER.parseDateTime(stringCoder.decode(inStream)),
DATE_TIME_FORMATTER.parseDateTime(stringCoder.decode(inStream)),
diff --git a/core/src/main/java/google/registry/beam/spec11/DomainNameInfo.java b/core/src/main/java/google/registry/beam/spec11/DomainNameInfo.java
index cdfa69e35..e8244ef74 100644
--- a/core/src/main/java/google/registry/beam/spec11/DomainNameInfo.java
+++ b/core/src/main/java/google/registry/beam/spec11/DomainNameInfo.java
@@ -14,30 +14,23 @@
package google.registry.beam.spec11;
-import com.google.auto.value.AutoValue;
import com.google.common.annotations.VisibleForTesting;
import java.io.Serializable;
/**
- * A POJO representing a domain name and associated info, parsed from a {@code SchemaAndRecord}.
+ * A record representing a domain name and associated info, parsed from a {@code SchemaAndRecord}.
*
*
This is a trivially serializable class that allows Beam to transform the results of a SQL
* query into a standard Java representation.
+ *
+ * @param domainName The fully qualified domain name.
+ * @param domainRepoId The domain repo ID (the primary key of the domain table).
+ * @param registrarId The registrar ID of the associated registrar for this domain.
+ * @param registrarEmailAddress The email address of the registrar associated with this domain.
*/
-@AutoValue
-public abstract class DomainNameInfo implements Serializable {
-
- /** Returns the fully qualified domain name. */
- abstract String domainName();
-
- /** Returns the domain repo ID (the primary key of the domain table). */
- abstract String domainRepoId();
-
- /** Returns the registrar ID of the associated registrar for this domain. */
- abstract String registrarId();
-
- /** Returns the email address of the registrar associated with this domain. */
- abstract String registrarEmailAddress();
+public record DomainNameInfo(
+ String domainName, String domainRepoId, String registrarId, String registrarEmailAddress)
+ implements Serializable {
/**
* Creates a concrete {@link DomainNameInfo}.
@@ -45,7 +38,6 @@ public abstract class DomainNameInfo implements Serializable {
@VisibleForTesting
static DomainNameInfo create(
String domainName, String domainRepoId, String registrarId, String registrarEmailAddress) {
- return new AutoValue_DomainNameInfo(
- domainName, domainRepoId, registrarId, registrarEmailAddress);
+ return new DomainNameInfo(domainName, domainRepoId, registrarId, registrarEmailAddress);
}
}
diff --git a/core/src/main/java/google/registry/beam/spec11/ThreatMatch.java b/core/src/main/java/google/registry/beam/spec11/ThreatMatch.java
index f4651cc87..794c48b6d 100644
--- a/core/src/main/java/google/registry/beam/spec11/ThreatMatch.java
+++ b/core/src/main/java/google/registry/beam/spec11/ThreatMatch.java
@@ -14,28 +14,26 @@
package google.registry.beam.spec11;
-import com.google.auto.value.AutoValue;
import com.google.common.annotations.VisibleForTesting;
import java.io.Serializable;
import org.json.JSONException;
import org.json.JSONObject;
-/** A POJO representing a threat match response from the {@code SafeBrowsing API}. */
-@AutoValue
-public abstract class ThreatMatch implements Serializable {
+/**
+ * A record representing a threat match response from the {@code SafeBrowsing API}.
+ *
+ * @param threatType What kind of threat this is (malware, phishing, etc.).
+ * @param domainName The fully qualified domain name of the matched threat.
+ */
+public record ThreatMatch(String threatType, String domainName) implements Serializable {
private static final String THREAT_TYPE_FIELD = "threatType";
private static final String DOMAIN_NAME_FIELD = "domainName";
private static final String OUTDATED_NAME_FIELD = "fullyQualifiedDomainName";
- /** Returns what kind of threat it is (malware, phishing etc.) */
- public abstract String threatType();
- /** Returns the fully qualified domain name [SLD].[TLD] of the matched threat. */
- public abstract String domainName();
-
@VisibleForTesting
static ThreatMatch create(String threatType, String domainName) {
- return new AutoValue_ThreatMatch(threatType, domainName);
+ return new ThreatMatch(threatType, domainName);
}
/** Returns a {@link JSONObject} representing a subset of this object's data. */
@@ -49,7 +47,7 @@ public abstract class ThreatMatch implements Serializable {
public static ThreatMatch fromJSON(JSONObject threatMatch) throws JSONException {
// TODO: delete OUTDATED_NAME_FIELD once we no longer process reports saved with
// fullyQualifiedDomainName in them, likely 2023
- return new AutoValue_ThreatMatch(
+ return new ThreatMatch(
threatMatch.getString(THREAT_TYPE_FIELD),
threatMatch.has(OUTDATED_NAME_FIELD)
? threatMatch.getString(OUTDATED_NAME_FIELD)
diff --git a/core/src/main/java/google/registry/model/tld/label/DomainLabelMetrics.java b/core/src/main/java/google/registry/model/tld/label/DomainLabelMetrics.java
index a046cc694..058f3c40d 100644
--- a/core/src/main/java/google/registry/model/tld/label/DomainLabelMetrics.java
+++ b/core/src/main/java/google/registry/model/tld/label/DomainLabelMetrics.java
@@ -14,7 +14,6 @@
package google.registry.model.tld.label;
-import com.google.auto.value.AutoValue;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableSet;
import com.google.monitoring.metrics.EventMetric;
@@ -43,16 +42,11 @@ class DomainLabelMetrics {
UNCACHED_POSITIVE
}
- @AutoValue
- abstract static class MetricsReservedListMatch {
+ record MetricsReservedListMatch(String reservedListName, ReservationType reservationType) {
static MetricsReservedListMatch create(
String reservedListName, ReservationType reservationType) {
- return new AutoValue_DomainLabelMetrics_MetricsReservedListMatch(
- reservedListName, reservationType);
+ return new MetricsReservedListMatch(reservedListName, reservationType);
}
-
- abstract String reservedListName();
- abstract ReservationType reservationType();
}
/**
diff --git a/core/src/main/java/google/registry/model/tld/label/PremiumListDao.java b/core/src/main/java/google/registry/model/tld/label/PremiumListDao.java
index 92795b704..fe4b14c13 100644
--- a/core/src/main/java/google/registry/model/tld/label/PremiumListDao.java
+++ b/core/src/main/java/google/registry/model/tld/label/PremiumListDao.java
@@ -23,7 +23,6 @@ import static google.registry.persistence.transaction.TransactionManagerFactory.
import static google.registry.util.CollectionUtils.isNullOrEmpty;
import com.github.benmanes.caffeine.cache.LoadingCache;
-import com.google.auto.value.AutoValue;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
@@ -236,14 +235,10 @@ public final class PremiumListDao {
.collect(toImmutableList());
}
- @AutoValue
- abstract static class RevisionIdAndLabel {
- abstract long revisionId();
-
- abstract String label();
+ record RevisionIdAndLabel(long revisionId, String label) {
static RevisionIdAndLabel create(long revisionId, String label) {
- return new AutoValue_PremiumListDao_RevisionIdAndLabel(revisionId, label);
+ return new RevisionIdAndLabel(revisionId, label);
}
}
diff --git a/core/src/main/java/google/registry/monitoring/whitebox/CheckApiMetric.java b/core/src/main/java/google/registry/monitoring/whitebox/CheckApiMetric.java
index a59799fd1..00bb9675d 100644
--- a/core/src/main/java/google/registry/monitoring/whitebox/CheckApiMetric.java
+++ b/core/src/main/java/google/registry/monitoring/whitebox/CheckApiMetric.java
@@ -16,14 +16,18 @@ package google.registry.monitoring.whitebox;
import static com.google.common.base.Preconditions.checkNotNull;
-import com.google.auto.value.AutoValue;
+import com.google.auto.value.AutoBuilder;
import google.registry.util.Clock;
import java.util.Optional;
import org.joda.time.DateTime;
-/** A value class for recording attributes of a domain check metric. */
-@AutoValue
-public abstract class CheckApiMetric {
+/** A record for recording attributes of a domain check metric. */
+public record CheckApiMetric(
+ DateTime startTimestamp,
+ DateTime endTimestamp,
+ Status status,
+ Optional tier,
+ Optional availability) {
/** Price tier of a domain name. */
public enum Tier {
@@ -77,24 +81,13 @@ public abstract class CheckApiMetric {
}
}
- public abstract DateTime startTimestamp();
-
- public abstract DateTime endTimestamp();
-
- public abstract Status status();
-
- public abstract Optional tier();
-
- public abstract Optional availability();
public static Builder builder(Clock clock) {
- return new AutoValue_CheckApiMetric.Builder().startTimestamp(clock.nowUtc()).setClock(clock);
+ return new AutoBuilder_CheckApiMetric_Builder().startTimestamp(clock.nowUtc()).setClock(clock);
}
- CheckApiMetric() {}
-
/** Builder for {@link CheckApiMetric}. */
- @AutoValue.Builder
+ @AutoBuilder
public abstract static class Builder {
private Clock clock;
diff --git a/core/src/main/java/google/registry/monitoring/whitebox/EppMetric.java b/core/src/main/java/google/registry/monitoring/whitebox/EppMetric.java
index 2b6c3db60..7abc3fa80 100644
--- a/core/src/main/java/google/registry/monitoring/whitebox/EppMetric.java
+++ b/core/src/main/java/google/registry/monitoring/whitebox/EppMetric.java
@@ -16,7 +16,7 @@ package google.registry.monitoring.whitebox;
import static com.google.common.base.Preconditions.checkArgument;
-import com.google.auto.value.AutoValue;
+import com.google.auto.value.AutoBuilder;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import google.registry.model.eppoutput.Result.Code;
@@ -25,30 +25,23 @@ import google.registry.util.Clock;
import java.util.Optional;
import org.joda.time.DateTime;
-/** A value class for recording attributes of an EPP metric. */
-@AutoValue
-public abstract class EppMetric {
+/** A record for recording attributes of an EPP metric. */
+public record EppMetric(
+ DateTime startTimestamp,
+ DateTime endTimestamp,
+ Optional commandName,
+ Optional registrarId,
+ Optional tld,
+ Optional status) {
- public abstract DateTime getStartTimestamp();
-
- public abstract DateTime getEndTimestamp();
-
- public abstract Optional getCommandName();
-
- public abstract Optional getRegistrarId();
-
- public abstract Optional getTld();
-
- public abstract Optional getStatus();
-
- /** Create an {@link EppMetric.Builder}. */
+ /** Create an {@link Builder}. */
public static Builder builder() {
- return new AutoValue_EppMetric.Builder();
+ return new AutoBuilder_EppMetric_Builder();
}
/**
- * Create an {@link EppMetric.Builder} for a request context, with the given request ID and
- * with start and end timestamps taken from the given clock.
+ * Create an {@link Builder} for a request context, with the given request ID and with start and
+ * end timestamps taken from the given clock.
*
*
The start timestamp is recorded now, and the end timestamp at {@code build()}.
*/
@@ -58,8 +51,32 @@ public abstract class EppMetric {
.setClock(clock);
}
+ public DateTime getStartTimestamp() {
+ return startTimestamp;
+ }
+
+ public DateTime getEndTimestamp() {
+ return endTimestamp;
+ }
+
+ public Optional getCommandName() {
+ return commandName;
+ }
+
+ public Optional getRegistrarId() {
+ return registrarId;
+ }
+
+ public Optional getTld() {
+ return tld;
+ }
+
+ public Optional getStatus() {
+ return status;
+ }
+
/** A builder to create instances of {@link EppMetric}. */
- @AutoValue.Builder
+ @AutoBuilder
public abstract static class Builder {
/** Builder-only clock to support automatic recording of endTimestamp on {@link #build()}. */
@@ -97,18 +114,14 @@ public abstract class EppMetric {
*/
public Builder setTlds(ImmutableSet tlds) {
switch (tlds.size()) {
- case 0:
- setTld(Optional.empty());
- break;
- case 1:
+ case 0 -> setTld(Optional.empty());
+ case 1 -> {
String tld = Iterables.getOnlyElement(tlds);
// Only record TLDs that actually exist, otherwise we can blow up cardinality by recording
// an arbitrarily large number of strings.
setTld(Optional.ofNullable(Tlds.getTlds().contains(tld) ? tld : "_invalid"));
- break;
- default:
- setTld("_various");
- break;
+ }
+ default -> setTld("_various");
}
return this;
}
diff --git a/core/src/main/java/google/registry/privileges/secretmanager/SecretManagerClient.java b/core/src/main/java/google/registry/privileges/secretmanager/SecretManagerClient.java
index 7b05ee45b..60be502ba 100644
--- a/core/src/main/java/google/registry/privileges/secretmanager/SecretManagerClient.java
+++ b/core/src/main/java/google/registry/privileges/secretmanager/SecretManagerClient.java
@@ -14,7 +14,6 @@
package google.registry.privileges.secretmanager;
-import com.google.auto.value.AutoValue;
import com.google.cloud.secretmanager.v1.SecretVersion;
import com.google.common.collect.Streams;
import java.util.Optional;
@@ -116,18 +115,11 @@ public interface SecretManagerClient {
void deleteSecret(String secretId);
/** Contains the {@link SecretVersion.State State} of an secret version. */
- @AutoValue
- abstract class SecretVersionState {
+ record SecretVersionState(String secretId, String version, SecretVersion.State state) {
- public abstract String secretId();
-
- public abstract String version();
-
- public abstract SecretVersion.State state();
-
- public static SecretVersionState of(
+ public static SecretVersionState create(
String secretId, String version, SecretVersion.State state) {
- return new AutoValue_SecretManagerClient_SecretVersionState(secretId, version, state);
+ return new SecretVersionState(secretId, version, state);
}
}
diff --git a/core/src/main/java/google/registry/privileges/secretmanager/SecretManagerClientImpl.java b/core/src/main/java/google/registry/privileges/secretmanager/SecretManagerClientImpl.java
index 599eb7c7d..e2b8b7206 100644
--- a/core/src/main/java/google/registry/privileges/secretmanager/SecretManagerClientImpl.java
+++ b/core/src/main/java/google/registry/privileges/secretmanager/SecretManagerClientImpl.java
@@ -94,7 +94,7 @@ public class SecretManagerClientImpl implements SecretManagerClient {
private static SecretVersionState toSecretVersionState(SecretVersion secretVersion) {
SecretVersionName name = SecretVersionName.parse(secretVersion.getName());
- return SecretVersionState.of(
+ return SecretVersionState.create(
name.getSecret(), name.getSecretVersion(), secretVersion.getState());
}
diff --git a/core/src/main/java/google/registry/privileges/secretmanager/SqlCredential.java b/core/src/main/java/google/registry/privileges/secretmanager/SqlCredential.java
index 05caa53dd..1d8a8c44d 100644
--- a/core/src/main/java/google/registry/privileges/secretmanager/SqlCredential.java
+++ b/core/src/main/java/google/registry/privileges/secretmanager/SqlCredential.java
@@ -16,7 +16,6 @@ package google.registry.privileges.secretmanager;
import static avro.shaded.com.google.common.base.Preconditions.checkState;
-import com.google.auto.value.AutoValue;
import java.util.List;
/**
@@ -24,32 +23,27 @@ import java.util.List;
*
*
User must take care not to include the {@link #SEPARATOR} in property values.
*/
-@AutoValue
-public abstract class SqlCredential {
+public record SqlCredential(String login, String password) {
public static final Character SEPARATOR = ' ';
- public abstract String login();
-
- public abstract String password();
-
@Override
- public final String toString() {
- // Use Object.toString(), which does not show object data.
- return super.toString();
+ public String toString() {
+ // Use the Object.toString() implementation, which does not show the sensitive date in fields.
+ return this.getClass().getName() + "@" + Integer.toHexString(this.hashCode());
}
- public final String toFormattedString() {
+ public String toFormattedString() {
return String.format("%s%c%s", login(), SEPARATOR, password());
}
public static SqlCredential fromFormattedString(String sqlCredential) {
List items = com.google.common.base.Splitter.on(SEPARATOR).splitToList(sqlCredential);
checkState(items.size() == 2, "Invalid SqlCredential string.");
- return of(items.get(0), items.get(1));
+ return create(items.get(0), items.get(1));
}
- public static SqlCredential of(String login, String password) {
- return new AutoValue_SqlCredential(login, password);
+ public static SqlCredential create(String login, String password) {
+ return new SqlCredential(login, password);
}
}
diff --git a/core/src/main/java/google/registry/privileges/secretmanager/SqlCredentialStore.java b/core/src/main/java/google/registry/privileges/secretmanager/SqlCredentialStore.java
index d72ba2f7d..1c81c7a95 100644
--- a/core/src/main/java/google/registry/privileges/secretmanager/SqlCredentialStore.java
+++ b/core/src/main/java/google/registry/privileges/secretmanager/SqlCredentialStore.java
@@ -79,7 +79,7 @@ public class SqlCredentialStore {
String credentialVersion =
csmClient.addSecretVersion(
credentialDataSecretId,
- SqlCredential.of(createDatabaseLoginName(user), password).toFormattedString());
+ SqlCredential.create(createDatabaseLoginName(user), password).toFormattedString());
return SecretVersionName.of(csmClient.getProject(), credentialDataSecretId, credentialVersion);
}
diff --git a/core/src/main/java/google/registry/rdap/RdapAuthorization.java b/core/src/main/java/google/registry/rdap/RdapAuthorization.java
index 0a230e26b..f9f50ca9d 100644
--- a/core/src/main/java/google/registry/rdap/RdapAuthorization.java
+++ b/core/src/main/java/google/registry/rdap/RdapAuthorization.java
@@ -14,13 +14,16 @@
package google.registry.rdap;
-import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableSet;
-import google.registry.model.ImmutableObject;
-/** Authorization information for RDAP data access. */
-@AutoValue
-public abstract class RdapAuthorization extends ImmutableObject {
+/**
+ * Authorization information for RDAP data access.
+ *
+ * @param role The role to be used for access.
+ * @param registrarIds The registrar client IDs for which access is granted (used only if the role
+ * is REGISTRAR.
+ */
+public record RdapAuthorization(Role role, ImmutableSet registrarIds) {
enum Role {
ADMINISTRATOR,
@@ -28,29 +31,20 @@ public abstract class RdapAuthorization extends ImmutableObject {
PUBLIC
}
- /** The role to be used for access. */
- public abstract Role role();
-
- /** The registrar client IDs for which access is granted (used only if the role is REGISTRAR. */
- public abstract ImmutableSet registrarIds();
-
static RdapAuthorization create(Role role, String registrarId) {
- return new AutoValue_RdapAuthorization(role, ImmutableSet.of(registrarId));
+ return create(role, ImmutableSet.of(registrarId));
}
static RdapAuthorization create(Role role, ImmutableSet clientIds) {
- return new AutoValue_RdapAuthorization(role, clientIds);
+ return new RdapAuthorization(role, clientIds);
}
boolean isAuthorizedForRegistrar(String registrarId) {
- switch (role()) {
- case ADMINISTRATOR:
- return true;
- case REGISTRAR:
- return registrarIds().contains(registrarId);
- default:
- return false;
- }
+ return switch (role()) {
+ case ADMINISTRATOR -> true;
+ case REGISTRAR -> registrarIds().contains(registrarId);
+ default -> false;
+ };
}
public static final RdapAuthorization PUBLIC_AUTHORIZATION =
diff --git a/core/src/main/java/google/registry/rde/DepositFragment.java b/core/src/main/java/google/registry/rde/DepositFragment.java
index 4f5d78fdd..997040d1b 100644
--- a/core/src/main/java/google/registry/rde/DepositFragment.java
+++ b/core/src/main/java/google/registry/rde/DepositFragment.java
@@ -14,22 +14,16 @@
package google.registry.rde;
-import com.google.auto.value.AutoValue;
+import java.io.Serial;
import java.io.Serializable;
/** Container of RDE resource marshalled by {@link RdeMarshaller}. */
-@AutoValue
-public abstract class DepositFragment implements Serializable {
+public record DepositFragment(RdeResourceType type, String xml, String error)
+ implements Serializable {
- private static final long serialVersionUID = -5241410684255467454L;
-
- public abstract RdeResourceType type();
- public abstract String xml();
- public abstract String error();
+ @Serial private static final long serialVersionUID = -5241410684255467454L;
public static DepositFragment create(RdeResourceType type, String xml, String error) {
- return new AutoValue_DepositFragment(type, xml, error);
+ return new DepositFragment(type, xml, error);
}
-
- DepositFragment() {}
}
diff --git a/core/src/main/java/google/registry/rde/PendingDeposit.java b/core/src/main/java/google/registry/rde/PendingDeposit.java
index dbd97962d..86048b8a4 100644
--- a/core/src/main/java/google/registry/rde/PendingDeposit.java
+++ b/core/src/main/java/google/registry/rde/PendingDeposit.java
@@ -16,7 +16,6 @@ package google.registry.rde;
import static com.google.common.base.Preconditions.checkState;
-import com.google.auto.value.AutoValue;
import google.registry.model.common.Cursor.CursorType;
import google.registry.model.rde.RdeMode;
import java.io.IOException;
@@ -46,52 +45,35 @@ import org.joda.time.Duration;
* arguments (see {@code RdePipeline#decodePendingDeposits}). The latter requires safe
* deserialization because the data crosses credential boundaries (See {@code
* SafeObjectInputStream}).
+ *
+ * @param manual True if deposits should be generated via manual operation, which does not update
+ * the cursor, and saves the generated deposits in a special manual subdirectory tree.
+ * @param tld TLD for which a deposit should be generated.
+ * @param watermark Watermark date for which a deposit should be generated.
+ * @param mode Which type of deposit to generate: full (RDE) or thin (BRDA).
+ * @param cursor The cursor type to update (not used in manual operation).
+ * @param interval Amount of time to increment the cursor (not used in manual operation).
+ * @param directoryWithTrailingSlash Subdirectory of bucket/manual in which files should be placed,
+ * including a trailing slash (used only in manual operation).
+ * @param revision Revision number for generated files; if absent, use the next available in the
+ * sequence (used only in manual operation).
*/
-@AutoValue
-public abstract class PendingDeposit implements Serializable {
+public record PendingDeposit(
+ boolean manual,
+ String tld,
+ DateTime watermark,
+ RdeMode mode,
+ CursorType cursor,
+ Duration interval,
+ String directoryWithTrailingSlash,
+ @Nullable Integer revision)
+ implements Serializable {
private static final long serialVersionUID = 3141095605225904433L;
- /**
- * True if deposits should be generated via manual operation, which does not update the cursor,
- * and saves the generated deposits in a special manual subdirectory tree.
- */
- public abstract boolean manual();
-
- /** TLD for which a deposit should be generated. */
- public abstract String tld();
-
- /** Watermark date for which a deposit should be generated. */
- public abstract DateTime watermark();
-
- /** Which type of deposit to generate: full (RDE) or thin (BRDA). */
- public abstract RdeMode mode();
-
- /** The cursor type to update (not used in manual operation). */
- @Nullable
- public abstract CursorType cursor();
-
- /** Amount of time to increment the cursor (not used in manual operation). */
- @Nullable
- public abstract Duration interval();
-
- /**
- * Subdirectory of bucket/manual in which files should be placed, including a trailing slash (used
- * only in manual operation).
- */
- @Nullable
- public abstract String directoryWithTrailingSlash();
-
- /**
- * Revision number for generated files; if absent, use the next available in the sequence (used
- * only in manual operation).
- */
- @Nullable
- public abstract Integer revision();
-
public static PendingDeposit create(
String tld, DateTime watermark, RdeMode mode, CursorType cursor, Duration interval) {
- return new AutoValue_PendingDeposit(false, tld, watermark, mode, cursor, interval, null, null);
+ return new PendingDeposit(false, tld, watermark, mode, cursor, interval, null, null);
}
public static PendingDeposit createInManualOperation(
@@ -100,15 +82,13 @@ public abstract class PendingDeposit implements Serializable {
RdeMode mode,
String directoryWithTrailingSlash,
@Nullable Integer revision) {
- return new AutoValue_PendingDeposit(
+ return new PendingDeposit(
true, tld, watermark, mode, null, null, directoryWithTrailingSlash, revision);
}
- PendingDeposit() {}
-
/**
* Specifies that {@link SerializedForm} be used for {@code SafeObjectInputStream}-compatible
- * custom-serialization of {@link AutoValue_PendingDeposit the AutoValue implementation class}.
+ * custom-serialization of {@link PendingDeposit the AutoValue implementation class}.
*
*
This method is package-protected so that the AutoValue implementation class inherits this
* behavior.
@@ -193,7 +173,7 @@ public abstract class PendingDeposit implements Serializable {
@Override
public PendingDeposit decode(InputStream inStream) throws IOException {
- return new AutoValue_PendingDeposit(
+ return new PendingDeposit(
BooleanCoder.of().decode(inStream),
StringUtf8Coder.of().decode(inStream),
DateTime.parse(StringUtf8Coder.of().decode(inStream)),
diff --git a/core/src/main/java/google/registry/rde/RdeFragmenter.java b/core/src/main/java/google/registry/rde/RdeFragmenter.java
index 93cbdf0ab..142f05beb 100644
--- a/core/src/main/java/google/registry/rde/RdeFragmenter.java
+++ b/core/src/main/java/google/registry/rde/RdeFragmenter.java
@@ -17,7 +17,6 @@ package google.registry.rde;
import static google.registry.model.EppResourceUtils.loadAtPointInTime;
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
-import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableMap;
import google.registry.model.EppResource;
import google.registry.model.contact.Contact;
@@ -96,14 +95,10 @@ public class RdeFragmenter {
}
/** Map key for {@link RdeFragmenter} cache. */
- @AutoValue
- abstract static class WatermarkModePair {
- abstract DateTime watermark();
-
- abstract RdeMode mode();
+ record WatermarkModePair(DateTime watermark, RdeMode mode) {
static WatermarkModePair create(DateTime watermark, RdeMode mode) {
- return new AutoValue_RdeFragmenter_WatermarkModePair(watermark, mode);
+ return new WatermarkModePair(watermark, mode);
}
}
}
diff --git a/core/src/main/java/google/registry/reporting/spec11/RegistrarThreatMatches.java b/core/src/main/java/google/registry/reporting/spec11/RegistrarThreatMatches.java
index 64259cfcc..6ad156339 100644
--- a/core/src/main/java/google/registry/reporting/spec11/RegistrarThreatMatches.java
+++ b/core/src/main/java/google/registry/reporting/spec11/RegistrarThreatMatches.java
@@ -14,20 +14,14 @@
package google.registry.reporting.spec11;
-import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import google.registry.beam.spec11.ThreatMatch;
import java.util.List;
-/** Value class representing the registrar and list-of-threat-matches pair stored in GCS. */
-@AutoValue
-public abstract class RegistrarThreatMatches {
-
- public abstract String clientId();
-
- public abstract ImmutableList threatMatches();
+/** Value record representing the registrar and list-of-threat-matches pair stored in GCS. */
+public record RegistrarThreatMatches(String clientId, ImmutableList threatMatches) {
static RegistrarThreatMatches create(String clientId, List threatMatches) {
- return new AutoValue_RegistrarThreatMatches(clientId, ImmutableList.copyOf(threatMatches));
+ return new RegistrarThreatMatches(clientId, ImmutableList.copyOf(threatMatches));
}
}
diff --git a/core/src/main/java/google/registry/request/Route.java b/core/src/main/java/google/registry/request/Route.java
index 66536174f..ed33991cf 100644
--- a/core/src/main/java/google/registry/request/Route.java
+++ b/core/src/main/java/google/registry/request/Route.java
@@ -14,7 +14,6 @@
package google.registry.request;
-import com.google.auto.value.AutoValue;
import java.util.function.Function;
/**
@@ -22,18 +21,13 @@ import java.util.function.Function;
*
* @see Router
*/
-@AutoValue
-abstract class Route {
+record Route(Action action, Function