Repository: firebase/firebase-admin-java
Pull request #596 (2021-09-13 22:00:41)

chore(deps): bump maven-javadoc-plugin from 3.3.0 to 3.3.1
Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.3.0 to 3.3.1.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/2d22ccadffc2f22f18e19c2cc6d42fd863b4535d"><code>2d22cca</code></a> [maven-release-plugin] prepare release maven-javadoc-plugin-3.3.1</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/7b7813e5ee6ba59ba75701c4d689337865bdc1f1"><code>7b7813e</code></a> [MJAVADOC-450] Artifacts with a classifier are ignored when looking for resou...</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/0d0e0cc7325fc27b89b7bde0ba2cbe322ff6a040"><code>0d0e0cc</code></a> [MJAVADOC-618] Goal javadoc:aggregate fails with submodules packaged as war</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/a2acaa28f1534b31429589808b630ebe2f08e3d0"><code>a2acaa2</code></a> [MJAVADOC-137] transform verify script from bsh to groovy</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/16ca1192632f2bfc4e10faa4aa24d319957008dc"><code>16ca119</code></a> Clean up slf4j-simple</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/87dbfb209e5b75ead8443d70a0c748d02a4f729b"><code>87dbfb2</code></a> [MJAVADOC-677] Using &quot;requires static transitive&quot; makes javadoc goal fail</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/d770460b765d2a3ccb9594a1a016c6700501861f"><code>d770460</code></a> [MJAVADOC-680] JDK 16+: Error fetching link: ...\target\javadoc-bundle-option...</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/292ebb7eca37a0cebbff8a40a7d85ea915f211ac"><code>292ebb7</code></a> Bump slf4j-simple from 1.7.30 to 1.7.32</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/fe6d738c2f95a3f5a361f0c4ab2eef49d37ae566"><code>fe6d738</code></a> Bump mockito-core from 3.9.0 to 3.12.0</li>
<li><a href="https://github.com/apache/maven-javadoc-plugin/commit/d2dd5321dc02e793d87c722224c40d94a607cb51"><code>d2dd532</code></a> [MJAVADOC-679] &quot;Unable to compute stale date&quot; in a directory with accent char...</li>
<li>Additional commits viewable in <a href="https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.3.0...maven-javadoc-plugin-3.3.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.apache.maven.plugins:maven-javadoc-plugin&package-manager=maven&previous-version=3.3.0&new-version=3.3.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE/bug_report.md
similarity index 91%
rename from ISSUE_TEMPLATE.md
rename to .github/ISSUE_TEMPLATE/bug_report.md
index 5de83b2..36eea6e 100644
--- a/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,3 +1,12 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: ''
+assignees: ''
+
+---
+
 ### [READ] Step 1: Are you in the right place?
 
   * For issues or feature requests related to __the code in this repository__
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..3408a0a
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: '[FR]'
+labels: 'type: feature request'
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/pom.xml b/pom.xml
index 340b59a..539f3ef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
 
     <groupId>com.google.firebase</groupId>
     <artifactId>firebase-admin</artifactId>
-    <version>8.0.1</version>
+    <version>8.1.0</version>
     <packaging>jar</packaging>
 
     <name>firebase-admin</name>
@@ -59,7 +59,7 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
         <skipUTs>${skipTests}</skipUTs>
-        <netty.version>4.1.67.Final</netty.version>
+        <netty.version>4.1.72.Final</netty.version>
     </properties>
 
     <scm>
@@ -77,16 +77,6 @@
     </distributionManagement>
 
     <profiles>
-        <profile>
-            <!-- Disable Doclint on Java 8 and higher -->
-            <id>disable-java8-doclint</id>
-            <activation>
-                <jdk>[1.8,)</jdk>
-            </activation>
-            <properties>
-                <additionalparam>-Xdoclint:none</additionalparam>
-            </properties>
-        </profile>
         <profile>
             <id>devsite-apidocs</id>
             <activation>
@@ -99,7 +89,7 @@
                     <plugin>
                         <!-- Generate API docs using Doclava for the developer site -->
                         <artifactId>maven-javadoc-plugin</artifactId>
-                        <version>3.3.0</version>
+                        <version>3.3.1</version>
                         <executions>
                             <execution>
                                 <phase>site</phase>
@@ -123,18 +113,19 @@
                                     <version>1.3</version>
                                 </additionalDependency>
                             </additionalDependencies>
-                            <additionalparam>
-                                -hdf book.path /docs/reference/_book.yaml
-                                -hdf project.path /_project.yaml
-                                -hdf devsite.path /docs/reference/admin/java/reference/
-                                -d ${project.build.directory}/apidocs
-                                -templatedir ${devsite.template}
-                                -toroot /docs/reference/admin/java/reference/
-                                -yaml _toc.yaml
-                                -warning 101
-                            </additionalparam>
+                            <additionalOptions>
+                                <additionalOption>-hdf book.path /docs/reference/_book.yaml</additionalOption>
+                                <additionalOption>-hdf project.path /_project.yaml</additionalOption>
+                                <additionalOption>-hdf devsite.path /docs/reference/admin/java/reference/</additionalOption>
+                                <additionalOption>-d ${project.build.directory}/apidocs</additionalOption>
+                                <additionalOption>-templatedir ${devsite.template}</additionalOption>
+                                <additionalOption>-toroot /docs/reference/admin/java/reference/</additionalOption>
+                                <additionalOption>-yaml _toc.yaml</additionalOption>
+                                <additionalOption>-warning 101</additionalOption>
+                            </additionalOptions>
                             <useStandardDocletOptions>false</useStandardDocletOptions>
                             <additionalJOption>-J-Xmx1024m</additionalJOption>
+                            <doclint>none</doclint>
                         </configuration>
                     </plugin>
                     <plugin>
@@ -310,7 +301,7 @@
             </plugin>
             <plugin>
                 <artifactId>maven-javadoc-plugin</artifactId>
-                <version>3.3.0</version>
+                <version>3.3.1</version>
                 <executions>
                     <execution>
                         <id>attach-javadocs</id>
@@ -334,11 +325,12 @@
                             <version>1.3</version>
                         </additionalDependency>
                     </additionalDependencies>
-                    <additionalparam>
-                        -warning 101
-                    </additionalparam>
+                    <additionalOptions>
+                        <additionalOption>-warning 101</additionalOption>
+                    </additionalOptions>
                     <useStandardDocletOptions>false</useStandardDocletOptions>
                     <additionalJOption>-J-Xmx1024m</additionalJOption>
+                    <doclint>none</doclint>
                 </configuration>
             </plugin>
 
diff --git a/src/main/java/com/google/firebase/remoteconfig/Parameter.java b/src/main/java/com/google/firebase/remoteconfig/Parameter.java
index d61816b..0b1ee6e 100644
--- a/src/main/java/com/google/firebase/remoteconfig/Parameter.java
+++ b/src/main/java/com/google/firebase/remoteconfig/Parameter.java
@@ -18,6 +18,7 @@ package com.google.firebase.remoteconfig;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
+import com.google.common.base.Strings;
 import com.google.firebase.internal.NonNull;
 import com.google.firebase.internal.Nullable;
 import com.google.firebase.remoteconfig.internal.TemplateResponse.ParameterResponse;
@@ -37,6 +38,7 @@ public final class Parameter {
   private ParameterValue defaultValue;
   private String description;
   private Map<String, ParameterValue> conditionalValues;
+  private ParameterValueType valueType;
 
   /**
    * Creates a new {@link Parameter}.
@@ -59,6 +61,9 @@ public final class Parameter {
     this.defaultValue = (responseDefaultValue == null) ? null
             : ParameterValue.fromParameterValueResponse(responseDefaultValue);
     this.description = parameterResponse.getDescription();
+    if (!Strings.isNullOrEmpty(parameterResponse.getValueType())) {
+      this.valueType = ParameterValueType.valueOf(parameterResponse.getValueType());
+    }
   }
 
   /**
@@ -93,6 +98,16 @@ public final class Parameter {
     return conditionalValues;
   }
 
+  /**
+   * Gets the data type of the parameter value.
+   *
+   * @return The data type of the parameter value or null.
+   */
+  @Nullable
+  public ParameterValueType getValueType() {
+    return valueType;
+  }
+
   /**
    * Sets the default value of the parameter.
    * This is the value to set the parameter to, when none of the named conditions
@@ -133,6 +148,18 @@ public final class Parameter {
     return this;
   }
 
+  /**
+   * Sets the data type of the parameter value.
+   * Defaults to `ParameterValueType.STRING` if unspecified.
+   *
+   * @param valueType The data type of the parameter value.
+   * @return This {@link Parameter}.
+   */
+  public Parameter setValueType(@Nullable ParameterValueType valueType) {
+    this.valueType = valueType;
+    return this;
+  }
+
   ParameterResponse toParameterResponse() {
     Map<String, ParameterValueResponse> conditionalResponseValues = new HashMap<>();
     for (Map.Entry<String, ParameterValue> entry : conditionalValues.entrySet()) {
@@ -143,7 +170,8 @@ public final class Parameter {
     return new ParameterResponse()
             .setDefaultValue(defaultValueResponse)
             .setDescription(description)
-            .setConditionalValues(conditionalResponseValues);
+            .setConditionalValues(conditionalResponseValues)
+            .setValueType(this.valueType == null ? null : this.valueType.getValueType());
   }
 
   @Override
@@ -157,11 +185,12 @@ public final class Parameter {
     Parameter parameter = (Parameter) o;
     return Objects.equals(defaultValue, parameter.defaultValue)
             && Objects.equals(description, parameter.description)
-            && Objects.equals(conditionalValues, parameter.conditionalValues);
+            && Objects.equals(conditionalValues, parameter.conditionalValues)
+            && Objects.equals(valueType, parameter.valueType);
   }
 
   @Override
   public int hashCode() {
-    return Objects.hash(defaultValue, description, conditionalValues);
+    return Objects.hash(defaultValue, description, conditionalValues, valueType);
   }
 }
diff --git a/src/main/java/com/google/firebase/remoteconfig/ParameterValueType.java b/src/main/java/com/google/firebase/remoteconfig/ParameterValueType.java
new file mode 100644
index 0000000..e9957cb
--- /dev/null
+++ b/src/main/java/com/google/firebase/remoteconfig/ParameterValueType.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.firebase.remoteconfig;
+
+/**
+ * Data types that are associated with parameter values.
+ */
+public enum ParameterValueType {
+  STRING("STRING"),
+  BOOLEAN("BOOLEAN"),
+  NUMBER("NUMBER"),
+  JSON("JSON");
+
+  private final String valueType;
+
+  ParameterValueType(String valueType) {
+    this.valueType = valueType;
+  }
+
+  public String getValueType() {
+    return valueType;
+  }
+}
diff --git a/src/main/java/com/google/firebase/remoteconfig/internal/TemplateResponse.java b/src/main/java/com/google/firebase/remoteconfig/internal/TemplateResponse.java
index 09e71ef..57a066b 100644
--- a/src/main/java/com/google/firebase/remoteconfig/internal/TemplateResponse.java
+++ b/src/main/java/com/google/firebase/remoteconfig/internal/TemplateResponse.java
@@ -107,6 +107,9 @@ public final class TemplateResponse {
     @Key("conditionalValues")
     private Map<String, ParameterValueResponse> conditionalValues;
 
+    @Key("valueType")
+    private String valueType;
+
     public ParameterValueResponse getDefaultValue() {
       return defaultValue;
     }
@@ -119,6 +122,10 @@ public final class TemplateResponse {
       return conditionalValues;
     }
 
+    public String getValueType() {
+      return valueType;
+    }
+
     public ParameterResponse setDefaultValue(
             ParameterValueResponse defaultValue) {
       this.defaultValue = defaultValue;
@@ -135,6 +142,11 @@ public final class TemplateResponse {
       this.conditionalValues = conditionalValues;
       return this;
     }
+
+    public ParameterResponse setValueType(String valueType) {
+      this.valueType = valueType;
+      return this;
+    }
   }
 
   /**


Test patch:
diff --git a/src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigClientImplTest.java b/src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigClientImplTest.java
index 71e6f81..f2d5c81 100644
--- a/src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigClientImplTest.java
+++ b/src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigClientImplTest.java
@@ -85,9 +85,11 @@ public class FirebaseRemoteConfigClientImplTest {
                   .setConditionalValues(ImmutableMap.<String, ParameterValue>of(
                           "ios_en", ParameterValue.of("welcome to app en")
                   ))
-                  .setDescription("text for welcome message!"),
+                  .setDescription("text for welcome message!")
+                  .setValueType(ParameterValueType.STRING),
           "header_text", new Parameter()
                   .setDefaultValue(ParameterValue.inAppDefault())
+                  .setValueType(ParameterValueType.STRING)
   );
 
   private static final Map<String, ParameterGroup> EXPECTED_PARAMETER_GROUPS = ImmutableMap.of(
@@ -97,6 +99,7 @@ public class FirebaseRemoteConfigClientImplTest {
                           "pumpkin_spice_season", new Parameter()
                                   .setDefaultValue(ParameterValue.of("true"))
                                   .setDescription("Whether it's currently pumpkin spice season.")
+                                  .setValueType(ParameterValueType.BOOLEAN)
                           )
                   )
   );
diff --git a/src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigIT.java b/src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigIT.java
index bb90c6c..07a3c6c 100644
--- a/src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigIT.java
+++ b/src/test/java/com/google/firebase/remoteconfig/FirebaseRemoteConfigIT.java
@@ -249,9 +249,11 @@ public class FirebaseRemoteConfigIT {
                             "ios_en",
                             ParameterValue.of(String.format("welcome to app en %s", timestamp))
                     ))
-                    .setDescription("text for welcome message!"),
+                    .setDescription("text for welcome message!")
+                    .setValueType(ParameterValueType.STRING),
             "header_text", new Parameter()
-                    .setDefaultValue(ParameterValue.inAppDefault()));
+                    .setDefaultValue(ParameterValue.inAppDefault())
+                    .setValueType(ParameterValueType.STRING));
   }
 
   private Map<String, ParameterGroup> getParameterGroups() {
@@ -262,7 +264,8 @@ public class FirebaseRemoteConfigIT {
                     .setParameters(ImmutableMap.of(
                             "pumpkin_spice_season", new Parameter()
                                     .setDefaultValue(ParameterValue.of("true"))
-                                    .setDescription("Whether it's currently pumpkin spice season."))
+                                    .setDescription("Whether it's currently pumpkin spice season.")
+                                    .setValueType(ParameterValueType.STRING))
                     ));
   }
 
diff --git a/src/test/java/com/google/firebase/remoteconfig/ParameterTest.java b/src/test/java/com/google/firebase/remoteconfig/ParameterTest.java
index 952ea8b..7fc6ee5 100644
--- a/src/test/java/com/google/firebase/remoteconfig/ParameterTest.java
+++ b/src/test/java/com/google/firebase/remoteconfig/ParameterTest.java
@@ -38,6 +38,7 @@ public class ParameterTest {
     assertTrue(parameter.getConditionalValues().isEmpty());
     assertNull(parameter.getDefaultValue());
     assertNull(parameter.getDescription());
+    assertNull(parameter.getValueType());
   }
 
   @Test(expected = NullPointerException.class)
@@ -84,8 +85,23 @@ public class ParameterTest {
             .setConditionalValues(conditionalValues);
 
     assertEquals(parameterFive, parameterSix);
+
+    final Parameter parameterSeven = new Parameter()
+            .setDefaultValue(ParameterValue.inAppDefault())
+            .setDescription("greeting text")
+            .setConditionalValues(conditionalValues)
+            .setValueType(ParameterValueType.STRING);
+    final Parameter parameterEight = new Parameter()
+            .setDefaultValue(ParameterValue.inAppDefault())
+            .setDescription("greeting text")
+            .setConditionalValues(conditionalValues)
+            .setValueType(ParameterValueType.STRING);
+
+    assertEquals(parameterSeven, parameterEight);
     assertNotEquals(parameterOne, parameterThree);
     assertNotEquals(parameterOne, parameterFive);
+    assertNotEquals(parameterOne, parameterSeven);
     assertNotEquals(parameterThree, parameterFive);
+    assertNotEquals(parameterThree, parameterSeven);
   }
 }
diff --git a/src/test/java/com/google/firebase/remoteconfig/TemplateTest.java b/src/test/java/com/google/firebase/remoteconfig/TemplateTest.java
index ad4d48f..a3ea3e8 100644
--- a/src/test/java/com/google/firebase/remoteconfig/TemplateTest.java
+++ b/src/test/java/com/google/firebase/remoteconfig/TemplateTest.java
@@ -49,7 +49,8 @@ public class TemplateTest {
           "greeting_header", new Parameter()
                   .setDefaultValue(ParameterValue.inAppDefault())
                   .setDescription("greeting header text")
-                  .setConditionalValues(CONDITIONAL_VALUES),
+                  .setConditionalValues(CONDITIONAL_VALUES)
+                  .setValueType(ParameterValueType.STRING),
           "greeting_text", new Parameter()
                   .setDefaultValue(ParameterValue.inAppDefault())
                   .setDescription("greeting text")
@@ -274,15 +275,17 @@ public class TemplateTest {
   public void testToJSONWithParameterValues() {
     Template t = new Template();
     t.getParameters()
-            .put("with_value", new Parameter().setDefaultValue(ParameterValue.of("hello")));
+            .put("with_value", new Parameter().setDefaultValue(ParameterValue.of("hello"))
+                    .setValueType(ParameterValueType.NUMBER));
     t.getParameters()
             .put("with_inApp", new Parameter().setDefaultValue(ParameterValue.inAppDefault()));
     String jsonString = t.toJSON();
 
     assertEquals("{\"conditions\":[],\"parameterGroups\":{},"
             + "\"parameters\":{\"with_value\":{\"conditionalValues\":{},"
-            + "\"defaultValue\":{\"value\":\"hello\"}},\"with_inApp\":{\"conditionalValues\":{},"
-            + "\"defaultValue\":{\"useInAppDefault\":true}}}}", jsonString);
+            + "\"defaultValue\":{\"value\":\"hello\"},\"valueType\":\"NUMBER\"},\"with_inApp\":{"
+            + "\"conditionalValues\":{},\"defaultValue\":{\"useInAppDefault\":true}"
+            + "}}}", jsonString);
   }
 
   @Test
diff --git a/src/test/resources/getRemoteConfig.json b/src/test/resources/getRemoteConfig.json
index a4969f0..a80caa0 100644
--- a/src/test/resources/getRemoteConfig.json
+++ b/src/test/resources/getRemoteConfig.json
@@ -20,12 +20,14 @@
           "value": "welcome to app en"
         }
       },
-      "description": "text for welcome message!"
+      "description": "text for welcome message!",
+      "valueType": "STRING"
     },
     "header_text": {
       "defaultValue": {
         "useInAppDefault": true
-      }
+      },
+      "valueType": "STRING"
     }
   },
   "parameterGroups": {
@@ -36,7 +38,8 @@
           "defaultValue": {
             "value": "true"
           },
-          "description": "Whether it's currently pumpkin spice season."
+          "description": "Whether it's currently pumpkin spice season.",
+          "valueType": "BOOLEAN"
         }
       }
     }