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

Mutations

54

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 → SURVIVED
Covering tests

66

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.21.0