ScopeKey: Replace lombok annotation with record type

Record classes: [1] were introduced in Java 14 as a preview feature
and were finalized in Java 17.

Given that the compiler level was changed to Java 17 in the latest
Gerrit releases per default use Java 17 language feature as a
replacement for lombok annotation processor.

Note to the tool support: This plugin and gerrit core itself is using
google-java-format to automatically format Java code. Unfortunately the
currently used gjf verion 1.7 is outdated and doesn't support record
classes. Therefore, a new version should be used to re-format reocrd
classes, e.g. v1.22.0: [2].

[1] https://docs.oracle.com/javase/specs/jls/se17/html/jls-8.html#jls-8.10
[2] https://github.com/google/google-java-format/releases/tag/v1.22.0

Change-Id: I979fbfe27ee68a1a7315103e90593c5278e4341d
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java
index 02889a1..b774419 100644
--- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java
+++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java
@@ -210,7 +210,7 @@
 
   private List<Scope> scopesForKey(HttpServletRequest req, String baseScopeKey) {
     return virtualDomainConfig.getScopes(req).entrySet().stream()
-        .filter(entry -> entry.getKey().name.equals(baseScopeKey))
+        .filter(entry -> entry.getKey().name().equals(baseScopeKey))
         .map(entry -> entry.getValue())
         .findFirst()
         .orElse(DEFAULT_SCOPES);
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfig.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfig.java
index 300a945..7645af5 100644
--- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfig.java
+++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfig.java
@@ -165,7 +165,7 @@
         .filter(k -> !k.endsWith("Sequence"))
         .collect(
             ImmutableSortedMap.toImmutableSortedMap(
-                Comparator.comparing(ScopeKey::getSequence),
+                Comparator.comparing(ScopeKey::sequence),
                 k ->
                     new ScopeKey(
                         k,
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/ScopeKey.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/ScopeKey.java
index a4751c7..6b7ecfb 100644
--- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/ScopeKey.java
+++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/ScopeKey.java
@@ -14,16 +14,4 @@
 
 package com.googlesource.gerrit.plugins.github.oauth;
 
-import lombok.Getter;
-
-public class ScopeKey {
-  @Getter public final String name;
-  @Getter public final String description;
-  @Getter public final int sequence;
-
-  public ScopeKey(String name, String description, int sequence) {
-    this.name = name;
-    this.description = description;
-    this.sequence = sequence;
-  }
-}
+public record ScopeKey(String name, String description, int sequence) {}
diff --git a/github-oauth/src/test/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfigTest.java b/github-oauth/src/test/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfigTest.java
index 7a11427..602fb76 100644
--- a/github-oauth/src/test/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfigTest.java
+++ b/github-oauth/src/test/java/com/googlesource/gerrit/plugins/github/oauth/GitHubOAuthConfigTest.java
@@ -196,13 +196,13 @@
     Map.Entry<ScopeKey, List<OAuthProtocol.Scope>> firstEntry = entries.get(0);
     Map.Entry<ScopeKey, List<OAuthProtocol.Scope>> secondEntry = entries.get(1);
 
-    assertEquals(firstEntry.getKey().name, scope1Name);
-    assertEquals(firstEntry.getKey().description, scope1Description);
-    assertEquals(firstEntry.getKey().sequence, 0);
+    assertEquals(firstEntry.getKey().name(), scope1Name);
+    assertEquals(firstEntry.getKey().description(), scope1Description);
+    assertEquals(firstEntry.getKey().sequence(), 0);
     assertEquals(List.of(OAuthProtocol.Scope.REPO), firstEntry.getValue());
-    assertEquals(secondEntry.getKey().name, scope2Name);
-    assertEquals(secondEntry.getKey().description, scope2Description);
-    assertEquals(secondEntry.getKey().sequence, 1);
+    assertEquals(secondEntry.getKey().name(), scope2Name);
+    assertEquals(secondEntry.getKey().description(), scope2Description);
+    assertEquals(secondEntry.getKey().sequence(), 1);
     assertEquals(List.of(OAuthProtocol.Scope.USER_EMAIL), secondEntry.getValue());
   }