Record Class Insert

java.lang.Object
java.lang.Record
pro.verron.officestamper.api.Insert
Record Components:
elements - The list of document elements to be inserted.

public record Insert(List<Object> elements) extends Record

The Insert record represents a container for managing collections of document elements that can be inserted into a DOCX document.

This record is used to wrap various types of document elements such as text runs, smart tag runs, and other WML objects that can be inserted into a document.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Insert(Object element)
    Creates an Insert with a single element.
    Insert(List<Object> elements)
    Compact constructor for Insert.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the elements record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    void
    setRPr(@Nullable org.docx4j.wml.RPr rPr)
    Sets the run properties for all runs in the list.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Insert

      public Insert(Object element)
      Creates an Insert with a single element.
      Parameters:
      element - the element to be inserted.
    • Insert

      public Insert(List<Object> elements)
      Compact constructor for Insert.
      Parameters:
      elements - elements to be copied.
  • Method Details

    • setRPr

      public void setRPr(@Nullable org.docx4j.wml.RPr rPr)
      Sets the run properties for all runs in the list.
      Parameters:
      rPr - the run properties to set.
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • elements

      public List<Object> elements()
      Returns the value of the elements record component.
      Returns:
      the value of the elements record component