OfficeStamperException.java

1
package pro.verron.officestamper.api;
2
3
import org.springframework.util.function.ThrowingFunction;
4
5
import java.util.function.Function;
6
import java.util.function.Supplier;
7
8
/// OfficeStamperException is a subclass of RuntimeException that represents an exception that can be thrown during the
9
/// processing of an Office document using the OfficeStamper library. It provides additional constructors to handle
10
/// different scenarios.
11
public class OfficeStamperException
12
        extends RuntimeException {
13
    /// OfficeStamperException is a subclass of RuntimeException that represents an exception that can be thrown during
14
    /// the processing of an Office document using the OfficeStamper library.
15
    ///
16
    /// @param message a message describing the error
17
    public OfficeStamperException(String message) {
18
        super(message);
19
    }
20
21
    /// OfficeStamperException is a subclass of RuntimeException that represents an exception that can be thrown during
22
    /// the processing of an Office document using the OfficeStamper library.
23
    ///
24
    /// @param cause the cause of the exception
25
    public OfficeStamperException(Throwable cause) {
26
        super(cause);
27
    }
28
29
    /// OfficeStamperException is a subclass of RuntimeException that represents an exception that can be thrown during
30
    /// the processing of an Office document using the OfficeStamper library.
31
    public OfficeStamperException() {
32
        super("Unexpected exception");
33
    }
34
35
    /// Creates a supplier that returns a new instance of [OfficeStamperException] with the specified message.
36
    ///
37
    /// @param message the message describing the exception
38
    /// @return a supplier that provides a new [OfficeStamperException] instance
39
    public static Supplier<OfficeStamperException> throwing(String message) {
40 2 1. lambda$throwing$0 : replaced return value with null for pro/verron/officestamper/api/OfficeStamperException::lambda$throwing$0 → NO_COVERAGE
2. throwing : replaced return value with null for pro/verron/officestamper/api/OfficeStamperException::throwing → TIMED_OUT
        return () -> new OfficeStamperException(message);
41
    }
42
43
    /// Wraps a ThrowingFunction into a standard Java Function, converting any checked exceptions thrown by the original
44
    /// function into an OfficeStamperException.
45
    ///
46
    /// @param <T> the type of the input to the function
47
    /// @param <U> the type of the result of the function
48
    /// @param function the throwing function to be wrapped
49
    /// @return a Function that wraps the specified ThrowingFunction and handles exceptions by throwing an
50
    ///         OfficeStamperException
51
    public static <T, U> Function<T, U> throwing(ThrowingFunction<T, U> function) {
52 1 1. throwing : replaced return value with null for pro/verron/officestamper/api/OfficeStamperException::throwing → KILLED
        return ThrowingFunction.of(function, OfficeStamperException::new);
53
    }
54
55
    /// OfficeStamperException is a subclass of RuntimeException that represents an exception that can be thrown during
56
    /// the processing of an Office document using the OfficeStamper library.
57
    ///
58
    /// @param message a message describing the error
59
    /// @param cause the cause of the exception
60
    public OfficeStamperException(String message, Throwable cause) {
61
        super(message, cause);
62
    }
63
}

Mutations

40

1.1
Location : lambda$throwing$0
Killed by : none
replaced return value with null for pro/verron/officestamper/api/OfficeStamperException::lambda$throwing$0 → NO_COVERAGE

2.2
Location : throwing
Killed by : none
replaced return value with null for pro/verron/officestamper/api/OfficeStamperException::throwing → TIMED_OUT

52

1.1
Location : throwing
Killed by : pro.verron.officestamper.test.RegressionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RegressionTests]/[method:test64()]
replaced return value with null for pro/verron/officestamper/api/OfficeStamperException::throwing → KILLED

Active mutators

Tests examined


Report generated by PIT 1.25.5 support