Insert.java

1
package pro.verron.officestamper.api;
2
3
import org.docx4j.wml.R;
4
import org.docx4j.wml.RPr;
5
import org.jspecify.annotations.Nullable;
6
7
import java.util.List;
8
9
import static java.util.Collections.singletonList;
10
11
/// The Insert record represents a container for managing collections of document elements that can be inserted into a
12
/// DOCX document.
13
///
14
/// This record is used to wrap various types of document elements such as text runs, smart tag runs, and other WML
15
/// objects that can be inserted into a document.
16
///
17
/// @param elements The list of document elements to be inserted.
18
public record Insert(List<Object> elements) {
19
20
    /// Creates an Insert with a single element.
21
    ///
22
    /// @param element the element to be inserted.
23
    public Insert(Object element) {
24
        this(singletonList(element));
25
    }
26
27
    /// Compact constructor for Insert.
28
    ///
29
    /// @param elements elements to be copied.
30
    public Insert {
31
        elements = List.copyOf(elements);
32
    }
33
34
    /// Sets the run properties for all runs in the list.
35
    ///
36
    /// @param rPr the run properties to set.
37
    public void setRPr(@Nullable RPr rPr) {
38
        elements.stream()
39
                .filter(R.class::isInstance)
40
                .map(R.class::cast)
41 2 1. lambda$setRPr$0 : removed call to org/docx4j/wml/R::setRPr → TIMED_OUT
2. setRPr : removed call to java/util/stream/Stream::forEach → TIMED_OUT
                .forEach(r -> r.setRPr(rPr));
42
    }
43
}

Mutations

41

1.1
Location : lambda$setRPr$0
Killed by : none
removed call to org/docx4j/wml/R::setRPr → TIMED_OUT

2.2
Location : setRPr
Killed by : none
removed call to java/util/stream/Stream::forEach → TIMED_OUT

Active mutators

Tests examined


Report generated by PIT 1.22.0