File tree 1 file changed +6
-5
lines changed
src/main/java/com/fasterxml/jackson/databind
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -631,17 +631,18 @@ public byte[] binaryValue() throws IOException {
631
631
public abstract String asText ();
632
632
633
633
/**
634
- * Method similar to {@link #asText()}, except that it will return
635
- * <code>defaultValue</code> in cases where null value would be returned;
636
- * either for missing nodes (trying to access missing property, or element
637
- * at invalid item for array) or explicit nulls.
634
+ * Returns the text value of this node or the provided {@code defaultValue} if this node
635
+ * does not have a text value. Useful for nodes that are {@link MissingNode} or
636
+ * {@link com.fasterxml.jackson.databind.node.NullNode}, ensuring a default value is returned instead of null or missing indicators.
637
+ *
638
638
*<p>
639
639
* NOTE: deprecated since 2.17 because {@link #asText()} very rarely returns
640
640
* {@code null} for any node types -- in fact, neither {@link MissingNode}
641
641
* nor {@code NullNode} return {@code null} from {@link #asText()}.
642
642
*
643
+ * @param defaultValue The default value to return if this node's text value is absent.
644
+ * @return The text value of this node, or defaultValue if the text value is absent.
643
645
* @since 2.4
644
- *
645
646
* @deprecated Since 2.17, to be removed from 3.0
646
647
*/
647
648
@ Deprecated // @since 2.17
You can’t perform that action at this time.
0 commit comments