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 thecommentrecord component.data()Returns the value of thedatarecord component.elements()Returns the value of theelementsrecord component.<T> List<T> Filters and retrieves elements from the internal list that are instances of the specified class type.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theoddNumberOfBreaksrecord component.Optional<org.docx4j.wml.SectPr> Returns the value of thepreviousSectionBreakrecord component.final StringtoString()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 aParagraphsrecord class.- Parameters:
comment- the value for thecommentrecord componentdata- the value for thedatarecord componentelements- the value for theelementsrecord componentpreviousSectionBreak- the value for thepreviousSectionBreakrecord componentoddNumberOfBreaks- the value for theoddNumberOfBreaksrecord 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 thecomparemethod from their corresponding wrapper classes. -
comment
-
data
-
elements
-
previousSectionBreak
Returns the value of thepreviousSectionBreakrecord component.- Returns:
- the value of the
previousSectionBreakrecord component
-
oddNumberOfBreaks
public boolean oddNumberOfBreaks()Returns the value of theoddNumberOfBreaksrecord component.- Returns:
- the value of the
oddNumberOfBreaksrecord component
-