Record Class Paragraphs
java.lang.Object
java.lang.Record
pro.verron.officestamper.preset.Paragraphs
- Record Components:
comment
- the comment metadata associated with the paragraphsdata
- an iterator over the data elements in the paragraphselements
- a list of objects representing elements in the paragraphspreviousSectionBreak
- an optional previous section break associated with the paragraphsoddNumberOfBreaks
- a flag indicating if there is an odd number of breaks
public record Paragraphs(Comment comment, Iterator<Object> data, List<Object> elements, Optional<org.docx4j.wml.SectPr> previousSectionBreak, boolean oddNumberOfBreaks)
extends Record
Represents a collection of paragraphs in a document, providing various methods to access and process the content within the paragraphs.
This record encapsulates metadata and content related to paragraphs, including comment metadata, a data iterator, a list of elements, an optional previous section break, and an indicator for whether there are an odd number of breaks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomment()
Returns the value of thecomment
record component.data()
Returns the value of thedata
record component.elements()
Returns the value of theelements
record component.<T> List
<T> Filters and retrieves elements from the internal list that are instances of the specified class type.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of theoddNumberOfBreaks
record component.Optional
<org.docx4j.wml.SectPr> Returns the value of thepreviousSectionBreak
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Paragraphs
public Paragraphs(Comment comment, Iterator<Object> data, List<Object> elements, Optional<org.docx4j.wml.SectPr> previousSectionBreak, boolean oddNumberOfBreaks) Creates an instance of aParagraphs
record class.- Parameters:
comment
- the value for thecomment
record componentdata
- the value for thedata
record componentelements
- the value for theelements
record componentpreviousSectionBreak
- the value for thepreviousSectionBreak
record componentoddNumberOfBreaks
- the value for theoddNumberOfBreaks
record component
-
-
Method Details
-
elements
Filters and retrieves elements from the internal list that are instances of the specified class type.- Type Parameters:
T
- the type of elements to be filtered and returned- Parameters:
aClass
- the class type used to filter and retrieve elements- Returns:
- a list of elements that are instances of the specified class type
-
toString
-
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. -
comment
-
data
-
elements
-
previousSectionBreak
Returns the value of thepreviousSectionBreak
record component.- Returns:
- the value of the
previousSectionBreak
record component
-
oddNumberOfBreaks
public boolean oddNumberOfBreaks()Returns the value of theoddNumberOfBreaks
record component.- Returns:
- the value of the
oddNumberOfBreaks
record component
-