Skip to content

docs: DOC-1179: JS API - Wrapper class docs#7775

Open
elijahpetty wants to merge 3 commits into
deephaven:mainfrom
elijahpetty:DOC-1179
Open

docs: DOC-1179: JS API - Wrapper class docs#7775
elijahpetty wants to merge 3 commits into
deephaven:mainfrom
elijahpetty:DOC-1179

Conversation

@elijahpetty

Copy link
Copy Markdown
Contributor

No description provided.

@elijahpetty elijahpetty requested a review from niloc132 March 9, 2026 18:34
@elijahpetty elijahpetty self-assigned this Mar 9, 2026
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

No docs changes detected for a9a65a9

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates JS client API wrapper classes with clearer Javadoc to improve generated documentation and clarify JS-facing conversion helpers.

Changes:

  • Added/expanded Javadoc on numeric wrappers (LongWrapper, BigIntegerWrapper, BigDecimalWrapper) covering parsing, numeric conversion, and valueOf()/toString().
  • Added Javadoc clarifying DateWrapper epoch-nanos semantics and JS Date conversions.
  • Added Javadoc to LocalDateWrapper describing field getters and string formatting.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
web/client-api/src/main/java/io/deephaven/web/client/api/LongWrapper.java Adds class/method Javadoc for parsing and JS-friendly conversions (asNumber, valueOf, toString).
web/client-api/src/main/java/io/deephaven/web/client/api/LocalDateWrapper.java Documents valueOf, date component getters, and toString formatting.
web/client-api/src/main/java/io/deephaven/web/client/api/DateWrapper.java Adds class-level and method Javadoc for nanos timestamps and JsDate conversions.
web/client-api/src/main/java/io/deephaven/web/client/api/BigIntegerWrapper.java Documents ofString, conversions, and equality/hash semantics.
web/client-api/src/main/java/io/deephaven/web/client/api/BigDecimalWrapper.java Documents ofString, conversions, and equality/hash semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +16 to +21
* This type extends {@link LongWrapper} and inherits the following conversions:
* <ul>
* <li>{@link LongWrapper#asNumber()} for a numeric representation</li>
* <li>{@link LongWrapper#toString()} and {@link LongWrapper#valueOf()} for string representations</li>
* <li>{@link LongWrapper#ofString(String)} for parsing</li>
* </ul>

Copilot AI Mar 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class Javadoc says DateWrapper “inherits … LongWrapper#ofString(String) for parsing”, but ofString returns a LongWrapper, not a DateWrapper. In JS, calling DateWrapper.ofString(...) would produce an instance without asDate(), which is surprising. Consider either adding a DateWrapper.ofString(String) that returns a DateWrapper, or adjusting the Javadoc to avoid implying a parsing API specific to DateWrapper.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That isn't how GWT exports static methods on classes - they aren't inherited, so there is no DateWrapper.ofString method.

The typedoc output does seem to believe that the class members are inherited though - but the return type is LongWrapper, anything that expects a DateWrapper will figure it out pretty quickly...

Comment on lines +18 to +20
* Creates a wrapper from an integer string.
*
* @param str A string value accepted by {@link BigInteger#BigInteger(String)}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't reference BigInteger in a meaningful way from js/ts

Suggested change
* Creates a wrapper from an integer string.
*
* @param str A string value accepted by {@link BigInteger#BigInteger(String)}.
* Creates a wrapper from an integer string. The provided string may start with {@code +} or {@code -}, and must otherwise only contain the digits 0-9.
*
* @param str A string representation of an integer.

/**
* Returns the wrapped value as a number.
*
* @return The {@link BigDecimal} value converted to a {@code double}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double doesnt mean anything in particular in JS

Suggested change
* @return The {@link BigDecimal} value converted to a {@code double}.
* @return The {@link BigDecimal} value converted to a JS {@code Number}.

(or just Number).

Comment on lines +19 to +21
* Creates a wrapper from a decimal string.
*
* @param value A string value accepted by {@link BigDecimal#BigDecimal(String)}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Creates a wrapper from a decimal string.
*
* @param value A string value accepted by {@link BigDecimal#BigDecimal(String)}.
* Creates a wrapper from a decimal string. Strings may optionally start with {@code +}/{@code -},
* must have a decimal value, and may end with {@code e}/{@code E} followed by an exponent.
*
* @param value A string decimal value with arbitrary precision.

Comment on lines +16 to +21
* This type extends {@link LongWrapper} and inherits the following conversions:
* <ul>
* <li>{@link LongWrapper#asNumber()} for a numeric representation</li>
* <li>{@link LongWrapper#toString()} and {@link LongWrapper#valueOf()} for string representations</li>
* <li>{@link LongWrapper#ofString(String)} for parsing</li>
* </ul>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That isn't how GWT exports static methods on classes - they aren't inherited, so there is no DateWrapper.ofString method.

The typedoc output does seem to believe that the class members are inherited though - but the return type is LongWrapper, anything that expects a DateWrapper will figure it out pretty quickly...

@elijahpetty elijahpetty requested a review from niloc132 June 12, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants