@@ -36,14 +36,8 @@ public interface Attributes {
3636 /**
3737 * Returns the value for the given {@link AttributeKey}, or {@code null} if not found.
3838 *
39- * <p>Simple attributes (i.e. anything other than {@link Value} attributes) SHOULD be used
40- * whenever possible. Instrumentations SHOULD assume that backends do not index individual
41- * properties of complex attributes, that querying or aggregating on such properties is
42- * inefficient and complicated, and that reporting complex attributes carries higher performance
43- * overhead.
44- *
45- * <p>Note: when passing a key of type {@link AttributeType#VALUE}, the returned value will match
46- * a narrower type with the given key if one exists. This is the inverse of {@link
39+ * <p>Note: this method will automatically convert simple attributes to complex attributes when
40+ * passed a key of type {@link AttributeType#VALUE}. This is the inverse of {@link
4741 * AttributesBuilder#put(AttributeKey, Object)} when the key is {@link AttributeType#VALUE}.
4842 *
4943 * <ul>
@@ -72,7 +66,12 @@ public interface Attributes {
7266 @ Nullable
7367 <T > T get (AttributeKey <T > key );
7468
75- /** Iterates over all the key-value pairs of attributes contained by this instance. */
69+ /**
70+ * Iterates over all the key-value pairs of attributes contained by this instance.
71+ *
72+ * <p>Note: {@link AttributeType#VALUE} attributes will be represented as simple attributes if
73+ * possible. See {@link AttributesBuilder#put(AttributeKey, Object)} for more details.
74+ */
7675 void forEach (BiConsumer <? super AttributeKey <?>, ? super Object > consumer );
7776
7877 /** The number of attributes contained in this. */
@@ -81,7 +80,12 @@ public interface Attributes {
8180 /** Whether there are any attributes contained in this. */
8281 boolean isEmpty ();
8382
84- /** Returns a read-only view of this {@link Attributes} as a {@link Map}. */
83+ /**
84+ * Returns a read-only view of this {@link Attributes} as a {@link Map}.
85+ *
86+ * <p>Note: {@link AttributeType#VALUE} attributes will be represented as simple attributes in
87+ * this map if possible. See {@link AttributesBuilder#put(AttributeKey, Object)} for more details.
88+ */
8589 Map <AttributeKey <?>, Object > asMap ();
8690
8791 /** Returns a {@link Attributes} instance with no attributes. */
0 commit comments