记录类 JsonWriter.MemberPath

java.lang.Object
java.lang.Record
org.springframework.boot.json.JsonWriter.MemberPath
记录组件:
parent - the parent of this path
name - the name of the member or null if the member is indexed. Path names are provided as they were defined when the member was added and do not include any name processing.
index - the index of the member or UNINDEXED
封闭接口:
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 '\'.
  • 字段详细资料

    • UNINDEXED

      public static final int UNINDEXED
      Indicates that the member has no index.
      另请参阅:
  • 构造器详细资料

    • MemberPath

      public MemberPath(JsonWriter.MemberPath parent, String name, int index)
      创建 MemberPath 记录类的实例。
      参数:
      parent - parent 记录组件的值
      name - name 记录组件的值
      index - index 记录组件的值
  • 方法详细资料

    • child

      public JsonWriter.MemberPath child(int index)
      Create a new child from this path with the specified index.
      参数:
      index - the index of the child
      返回:
      a new JsonWriter.MemberPath instance
    • child

      public JsonWriter.MemberPath child(String name)
      Create a new child from this path with the specified name.
      参数:
      name - the name of the child
      返回:
      a new JsonWriter.MemberPath instance
    • toString

      public final String toString()
      返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。
      指定者:
      toString 在类中 Record
      返回:
      此对象的字符串表示形式
    • toUnescapedString

      public final String toUnescapedString()
      Return a string representation of the path without any escaping.
      返回:
      the unescaped string representation
    • of

      public static JsonWriter.MemberPath of(String value)
      Create a new JsonWriter.MemberPath instance from the given string.
      参数:
      value - the path value
      返回:
      a new JsonWriter.MemberPath instance
    • hashCode

      public final int hashCode()
      返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。
      指定者:
      hashCode 在类中 Record
      返回:
      此对象的哈希代码值
    • equals

      public final boolean equals(Object o)
      指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 使用 Objects::equals(Object,Object) 对参考组件进行比较;使用 '==' 对基元组件进行比较
      指定者:
      equals 在类中 Record
      参数:
      o - 要与之进行比较的对象
      返回:
      如果此对象与 o 参数相同,则为 true;否则为 false
    • parent

      public JsonWriter.MemberPath parent()
      返回 parent 记录组件的值。
      返回:
      parent 记录组件的值
    • name

      public String name()
      返回 name 记录组件的值。
      返回:
      name 记录组件的值
    • index

      public int index()
      返回 index 记录组件的值。
      返回:
      index 记录组件的值