Repository navigation
Expand file tree
/
Copy pathFailing.java
More file actions
64 lines (53 loc) · 1.6 KB
/
Copy pathFailing.java
File metadata and controls
64 lines (53 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Copyright 2019 National Bank of Belgium
*
* Licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://ec.europa.eu/idabc/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package _test;
import nbbrd.console.properties.ConsoleProperties;
import java.nio.charset.Charset;
import java.util.function.Supplier;
/**
* @author Philippe Charles
*/
@lombok.AllArgsConstructor
public final class Failing implements ConsoleProperties.Spi {
public static final Failing NPE = new Failing(CustomRuntimeException::new);
@lombok.NonNull
private final Supplier<? extends RuntimeException> exception;
@Override
public boolean isAvailable() {
throw exception.get();
}
@Override
public int getRank() {
throw exception.get();
}
@Override
public Charset getStdInEncodingOrNull() {
throw exception.get();
}
@Override
public Charset getStdOutEncodingOrNull() {
throw exception.get();
}
@Override
public int getColumns() {
throw exception.get();
}
@Override
public int getRows() {
throw exception.get();
}
}