-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for java.time.Instant in Firebase Timestamp #5853
Conversation
Coverage Report 1Affected Products
Test Logs |
Javadoc Changes:--- /home/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/Timestamp.html 2024-04-16 21:33:17.906582503 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/Timestamp.html 2024-04-16 21:30:35.843596710 +0000
@@ -107,6 +107,11 @@
</tr>
<tr>
<td>
+ <div><code>@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi.html">RequiresApi</a>(value = 26)<br><a href="/docs/reference/android/com/google/firebase/Timestamp.html#Timestamp(java.time.Instant)">Timestamp</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/time/Instant.html">Instant</a> time)</code></div>
+ </td>
+ </tr>
+ <tr>
+ <td>
<div><code><a href="/docs/reference/android/com/google/firebase/Timestamp.html#Timestamp(kotlin.Long,kotlin.Int)">Timestamp</a>(long seconds, int nanoseconds)</code></div>
<p>Creates a new <code><a href="/docs/reference/android/com/google/firebase/Timestamp.html">Timestamp</a></code>.</p>
</td>
@@ -164,6 +169,13 @@
</td>
</tr>
<tr>
+ <td><code>final @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/time/Instant.html">Instant</a></code></td>
+ <td>
+ <div><code>@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi.html">RequiresApi</a>(value = 26)<br><a href="/docs/reference/android/com/google/firebase/Timestamp.html#toInstant()">toInstant</a>()</code></div>
+ <p>Returns a new <code><a href="https://developer.android.com/reference/kotlin/java/time/Instant.html">Instant</a></code> that matches the time defined by this timestamp.</p>
+ </td>
+ </tr>
+ <tr>
<td><code>@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/lang/String.html">String</a></code></td>
<td>
<div><code><a href="/docs/reference/android/com/google/firebase/Timestamp.html#toString()">toString</a>()</code></div>
@@ -199,6 +211,10 @@
<h3 class="api-name" id="Timestamp(java.util.Date)">Timestamp</h3>
<pre class="api-signature no-pretty-print">public <a href="/docs/reference/android/com/google/firebase/Timestamp.html#Timestamp(java.util.Date)">Timestamp</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/util/Date.html">Date</a> date)</pre>
</div>
+ <div class="api-item"><a name="Timestamp-java.time.Instant-"></a><a name="timestamp"></a>
+ <h3 class="api-name" id="Timestamp(java.time.Instant)">Timestamp</h3>
+ <pre class="api-signature no-pretty-print">@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi.html">RequiresApi</a>(value = 26)<br>public <a href="/docs/reference/android/com/google/firebase/Timestamp.html#Timestamp(java.time.Instant)">Timestamp</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/time/Instant.html">Instant</a> time)</pre>
+ </div>
<div class="api-item"><a name="Timestamp(kotlin.Long, kotlin.Int)"></a><a name="Timestamp-kotlin.Long-kotlin.Int-"></a><a name="timestamp"></a>
<h3 class="api-name" id="Timestamp(kotlin.Long,kotlin.Int)">Timestamp</h3>
<pre class="api-signature no-pretty-print">public <a href="/docs/reference/android/com/google/firebase/Timestamp.html#Timestamp(kotlin.Long,kotlin.Int)">Timestamp</a>(long seconds, int nanoseconds)</pre>
@@ -260,6 +276,11 @@
<p>Returns a new <code><a href="https://developer.android.com/reference/kotlin/java/util/Date.html">Date</a></code> corresponding to this timestamp.</p>
<p>This may lose precision.</p>
</div>
+ <div class="api-item"><a name="toInstant--"></a><a name="toinstant"></a>
+ <h3 class="api-name" id="toInstant()">toInstant</h3>
+ <pre class="api-signature no-pretty-print">@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi.html">RequiresApi</a>(value = 26)<br>public final @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/time/Instant.html">Instant</a> <a href="/docs/reference/android/com/google/firebase/Timestamp.html#toInstant()">toInstant</a>()</pre>
+ <p>Returns a new <code><a href="https://developer.android.com/reference/kotlin/java/time/Instant.html">Instant</a></code> that matches the time defined by this timestamp.</p>
+ </div>
<div class="api-item"><a name="toString--"></a><a name="tostring"></a>
<h3 class="api-name" id="toString()">toString</h3>
<pre class="api-signature no-pretty-print">public @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/lang/String.html">String</a> <a href="/docs/reference/android/com/google/firebase/Timestamp.html#toString()">toString</a>()</pre> --- /home/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/Timestamp.html 2024-04-16 21:33:17.906582503 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/Timestamp.html 2024-04-16 21:30:35.839596736 +0000
@@ -96,6 +96,11 @@
</tr>
<tr>
<td>
+ <div><code>@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi.html">RequiresApi</a>(value = 26)<br><a href="/docs/reference/kotlin/com/google/firebase/Timestamp.html#Timestamp(java.time.Instant)">Timestamp</a>(time: <a href="https://developer.android.com/reference/kotlin/java/time/Instant.html">Instant</a>)</code></div>
+ </td>
+ </tr>
+ <tr>
+ <td>
<div><code><a href="/docs/reference/kotlin/com/google/firebase/Timestamp.html#Timestamp(kotlin.Long,kotlin.Int)">Timestamp</a>(seconds: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html">Long</a>, nanoseconds: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>)</code></div>
<p>Creates a new <code><a href="/docs/reference/kotlin/com/google/firebase/Timestamp.html">Timestamp</a></code>.</p>
</td>
@@ -147,6 +152,13 @@
</td>
</tr>
<tr>
+ <td><code><a href="https://developer.android.com/reference/kotlin/java/time/Instant.html">Instant</a></code></td>
+ <td>
+ <div><code>@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi.html">RequiresApi</a>(value = 26)<br><a href="/docs/reference/kotlin/com/google/firebase/Timestamp.html#toInstant()">toInstant</a>()</code></div>
+ <p>Returns a new <code><a href="https://developer.android.com/reference/kotlin/java/time/Instant.html">Instant</a></code> that matches the time defined by this timestamp.</p>
+ </td>
+ </tr>
+ <tr>
<td><code>open <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></code></td>
<td>
<div><code><a href="/docs/reference/kotlin/com/google/firebase/Timestamp.html#toString()">toString</a>()</code></div>
@@ -208,6 +220,10 @@
<h3 class="api-name" id="Timestamp(java.util.Date)">Timestamp</h3>
<pre class="api-signature no-pretty-print"><a href="/docs/reference/kotlin/com/google/firebase/Timestamp.html#Timestamp(java.util.Date)">Timestamp</a>(date: <a href="https://developer.android.com/reference/kotlin/java/util/Date.html">Date</a>)</pre>
</div>
+ <div class="api-item"><a name="Timestamp-java.time.Instant-"></a><a name="timestamp"></a>
+ <h3 class="api-name" id="Timestamp(java.time.Instant)">Timestamp</h3>
+ <pre class="api-signature no-pretty-print">@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi.html">RequiresApi</a>(value = 26)<br><a href="/docs/reference/kotlin/com/google/firebase/Timestamp.html#Timestamp(java.time.Instant)">Timestamp</a>(time: <a href="https://developer.android.com/reference/kotlin/java/time/Instant.html">Instant</a>)</pre>
+ </div>
<div class="api-item"><a name="Timestamp(kotlin.Long, kotlin.Int)"></a><a name="Timestamp-kotlin.Long-kotlin.Int-"></a><a name="timestamp"></a>
<h3 class="api-name" id="Timestamp(kotlin.Long,kotlin.Int)">Timestamp</h3>
<pre class="api-signature no-pretty-print"><a href="/docs/reference/kotlin/com/google/firebase/Timestamp.html#Timestamp(kotlin.Long,kotlin.Int)">Timestamp</a>(seconds: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html">Long</a>, nanoseconds: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a>)</pre>
@@ -265,6 +281,11 @@
<p>Returns a new <code><a href="https://developer.android.com/reference/kotlin/java/util/Date.html">Date</a></code> corresponding to this timestamp.</p>
<p>This may lose precision.</p>
</div>
+ <div class="api-item"><a name="toInstant--"></a><a name="toinstant"></a>
+ <h3 class="api-name" id="toInstant()">toInstant</h3>
+ <pre class="api-signature no-pretty-print">@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi.html">RequiresApi</a>(value = 26)<br>fun <a href="/docs/reference/kotlin/com/google/firebase/Timestamp.html#toInstant()">toInstant</a>(): <a href="https://developer.android.com/reference/kotlin/java/time/Instant.html">Instant</a></pre>
+ <p>Returns a new <code><a href="https://developer.android.com/reference/kotlin/java/time/Instant.html">Instant</a></code> that matches the time defined by this timestamp.</p>
+ </div>
<div class="api-item"><a name="toString--"></a><a name="tostring"></a>
<h3 class="api-name" id="toString()">toString</h3>
<pre class="api-signature no-pretty-print">open fun <a href="/docs/reference/kotlin/com/google/firebase/Timestamp.html#toString()">toString</a>(): <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a></pre> |
Size Report 1Affected Products
Test Logs |
This reverts commit 84606ed.
100ad28
to
71d2a13
Compare
a6a7efd
to
49defa5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'll mark my review as "Approved" once the API proposal (go/java-instant-in-firebase-timestamp for Googlers) is approved by API council.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I defer the final approval to @dconeybe for post api council.
Co-authored-by: Daymon <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved! Please wait for the base PR to be merged so you can merge this PR directly into the master branch.
88e401e
to
07b5bfb
Compare
The public api surface has changed for the subproject firebase-common: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
Startup Time Report 1Note: Layout is sometimes suboptimal due to limited formatting support on GitHub. Please check this report on GCS. Notes
Startup Times
|
No description provided.