Skip to content
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

Adds useful kdocs for all members declared in AnyElement and other kdocs improvements #73

Merged
merged 2 commits into from
Jun 3, 2022

Conversation

popematt
Copy link
Contributor

@popematt popematt commented Jun 1, 2022

Issue #, if available:

#67

Description of changes:

This adds the documentation changes mentioned in #67

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

cheqianh
cheqianh previously approved these changes Jun 2, 2022
rmarrowstone
rmarrowstone previously approved these changes Jun 2, 2022
/** See [AnyElement]. */
/**
* Attempts to narrow this element to a [IntElement] or `null`.
* If this element is not an Ion `bool` or `null.null`, throws an [IonElementConstraintException].

Choose a reason for hiding this comment

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

s/bool/int

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch—thank you!

public fun asStructOrNull(): StructElement?

/**
* If this is an Ion integer, returns its [IntElementSize] otherwise, throws [IonElementConstraintException].
*/
public val integerSize: IntElementSize

/** See [AnyElement]. */
/**
* Gets the value of the element, assuming that it is a non-null Ion `bool`.

Choose a reason for hiding this comment

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

Nit: I wouldn't use the term 'gets' for properties.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was not thrilled with "gets", but I couldn't think of a better way to phrase it. Got any suggestions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about something like this?

Suggested change
* Gets the value of the element, assuming that it is a non-null Ion `bool`.
* The value of the element, assuming that the element is a non-null Ion `bool`.
* Attempting to access this property on an element that violates the type assumption will result in an [IonElementConstraintException].

Choose a reason for hiding this comment

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

Yea... I want to suggest "Access" though that may be a bit wordy.

@popematt popematt dismissed stale reviews from rmarrowstone and cheqianh via ba8ffd8 June 3, 2022 14:13
@codecov-commenter
Copy link

Codecov Report

Merging #73 (ba8ffd8) into master (67e1dff) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master      #73   +/-   ##
=========================================
  Coverage     88.06%   88.06%           
  Complexity      453      453           
=========================================
  Files            30       30           
  Lines           821      821           
  Branches         72       72           
=========================================
  Hits            723      723           
  Misses           65       65           
  Partials         33       33           
Impacted Files Coverage Δ
src/com/amazon/ionelement/api/IonElement.kt 100.00% <ø> (ø)
src/com/amazon/ionelement/api/IonLocation.kt 66.66% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67e1dff...ba8ffd8. Read the comment docs.

@popematt popematt merged commit 0bb79e5 into amazon-ion:master Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants