Skip to content
This repository was archived by the owner on Dec 23, 2023. It is now read-only.

Commit ab7ecf1

Browse files
author
Dino Oliva
committed
Adds better javadoc on TagKey/Value factory methods.
1 parent 42554d2 commit ab7ecf1

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

core/java/com/google/instrumentation/stats/TagKey.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ public final class TagKey {
2222
public static final int MAX_LENGTH = StringUtil.MAX_LENGTH;
2323

2424
/**
25-
* Constructs a new {@link TagKey} from the given string.
25+
* Constructs a new {@link TagKey} from the given string. The string will be sanitize such that:
26+
* <ol>
27+
* <li>length is restricted to {@link MAX_LENGTH}, strings longer than that will be truncated.
28+
* <li>characters are restricted to printable ascii characters, non-printable characters will be
29+
* replaced by an underscore '_'.
30+
* </ol>
2631
*/
2732
public static TagKey create(String key) {
2833
return new TagKey(key);

core/java/com/google/instrumentation/stats/TagValue.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ public final class TagValue {
2222
public static final int MAX_LENGTH = StringUtil.MAX_LENGTH;
2323

2424
/**
25-
* Constructs a new {@link TagKey} from the given string.
25+
* Constructs a new {@link TagValue} from the given string. The string will be sanitize such that:
26+
* <ol>
27+
* <li>length is restricted to {@link MAX_LENGTH}, strings longer than that will be truncated.
28+
* <li>characters are restricted to printable ascii characters, non-printable characters will be
29+
* replaced by an underscore '_'.
30+
* </ol>
2631
*/
2732
public static TagValue create(String value) {
2833
return new TagValue(value);

0 commit comments

Comments
 (0)