Passed
Push — main ( e3287a...08aeb5 )
by Hao
03:41
created

getBindingResult()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 2
ccs 0
cts 1
cp 0
crap 2
rs 10
c 0
b 0
f 0
eloc 2
1
package io.github.ro4;
2
3
import org.springframework.lang.Nullable;
4
import org.springframework.util.Assert;
5
import org.springframework.validation.BindingResult;
6
7
8
@SuppressWarnings("all")
9
public class CheckFailedException extends RuntimeException {
10
11
12
    private final BindingResult bindingResult;
13
14 1
    public CheckFailedException(BindingResult bindingResult) {
15 1
        Assert.notNull(bindingResult, "BindingResult must not be null");
16 1
        this.bindingResult = bindingResult;
17 1
    }
18
19
    public final BindingResult getBindingResult() {
20
        return this.bindingResult;
21
    }
22
23
24
    /**
25
     * Returns diagnostic information about the errors held in this object.
26
     */
27
    @Override
28
    public String getMessage() {
29 1
        return this.bindingResult.toString();
30
    }
31
32
    @Override
33
    public boolean equals(@Nullable Object other) {
34
        return (this == other || this.bindingResult.equals(other));
35
    }
36
37
    @Override
38
    public int hashCode() {
39
        return this.bindingResult.hashCode();
40
    }
41
}
42