Record Class JsonWriter.MemberPath
java.lang.Object
java.lang.Record
org.springframework.boot.json.JsonWriter.MemberPath
- Record Components:
parent
- the parent of this pathname
- the name of the member ornull
if the member is indexed. Path names are provided as they were defined when the member was added and do not include anyname processing
.index
- the index of the member orUNINDEXED
- Enclosing interface:
JsonWriter<T>
public static record JsonWriter.MemberPath(JsonWriter.MemberPath parent, String name, int index)
extends Record
A path used to identify a specific JSON member. Paths can be represented as strings
in form
"my.json[1].item"
where elements are separated by '.'
or
[<index>]
. Reserved characters are escaped using '\'
.- Since:
- 3.4.0
- Author:
- Phillip Webb, Moritz Halbritter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Indicates that the member has no index. -
Constructor Summary
ConstructorsConstructorDescriptionMemberPath
(JsonWriter.MemberPath parent, String name, int index) Creates an instance of aMemberPath
record class. -
Method Summary
Modifier and TypeMethodDescriptionchild
(int index) Create a new child from this path with the specified index.Create a new child from this path with the specified name.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
index()
Returns the value of theindex
record component.name()
Returns the value of thename
record component.static JsonWriter.MemberPath
Create a newJsonWriter.MemberPath
instance from the given string.parent()
Returns the value of theparent
record component.final String
toString()
Returns a string representation of this record class.final String
Return a string representation of the path without any escaping.
-
Field Details
-
UNINDEXED
public static final int UNINDEXEDIndicates that the member has no index.- See Also:
-
-
Constructor Details
-
Method Details
-
child
Create a new child from this path with the specified index.- Parameters:
index
- the index of the child- Returns:
- a new
JsonWriter.MemberPath
instance
-
child
Create a new child from this path with the specified name.- Parameters:
name
- the name of the child- Returns:
- a new
JsonWriter.MemberPath
instance
-
toString
-
toUnescapedString
Return a string representation of the path without any escaping.- Returns:
- the unescaped string representation
-
of
Create a newJsonWriter.MemberPath
instance from the given string.- Parameters:
value
- the path value- Returns:
- a new
JsonWriter.MemberPath
instance
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with thecompare
method from their corresponding wrapper classes. -
parent
-
name
-
index
-