Record Class SplitResult

java.lang.Object
java.lang.Record
cloud.opencode.base.xml.splitter.SplitResult
Record Components:
index - the zero-based index of this fragment | 此片段的基于零的索引
fragment - the extracted XML document fragment | 提取的 XML 文档片段

public record SplitResult(int index, XmlDocument fragment) extends Record
Split Result - Holds an indexed XML fragment from a split operation 拆分结果 - 保存拆分操作中带索引的 XML 片段

This record pairs a zero-based index with the corresponding XML document fragment extracted by XmlSplitter.

此记录将基于零的索引与 XmlSplitter 提取的相应 XML 文档片段配对。

Since:
JDK 25, opencode-base-xml V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Constructor Details

    • SplitResult

      public SplitResult(int index, XmlDocument fragment)
      Creates an instance of a SplitResult record class.
      Parameters:
      index - the value for the index record component
      fragment - the value for the fragment record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • fragment

      public XmlDocument fragment()
      Returns the value of the fragment record component.
      Returns:
      the value of the fragment record component