Skip to content

Commit 4a092e2

Browse files
authored
Merge pull request #8 from ArtemGet/func
Add entry functions, change yaml dependency scope to provided
2 parents a02f694 + acd0202 commit 4a092e2

File tree

5 files changed

+133
-1
lines changed

5 files changed

+133
-1
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,31 @@ This library is distributed via [jitpack.io](https://jitpack.io/#ArtemGet/entrys
2222

2323
1) Properties passed via -D
2424
2) Environment variables
25-
3) Json strings
25+
3) Json strings
26+
27+
Note that using json entries requires additional dependencies:
28+
29+
```xml
30+
31+
<dependency>
32+
<groupId>org.glassfish</groupId>
33+
<artifactId>jakarta.json</artifactId>
34+
<version>1.1.6</version>
35+
</dependency>
36+
```
37+
2638
4) Yaml files
2739

40+
Note that using yaml entries requires additional dependencies:
41+
42+
```xml
43+
<dependency>
44+
<groupId>com.amihaiemil.web</groupId>
45+
<artifactId>eo-yaml</artifactId>
46+
<version>8.0.6</version>
47+
</dependency>
48+
```
49+
2850
# Examples
2951

3052
## Properties:

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<groupId>com.amihaiemil.web</groupId>
2222
<artifactId>eo-yaml</artifactId>
2323
<version>8.0.6</version>
24+
<scope>provided</scope>
2425
<exclusions>
2526
<exclusion>
2627
<groupId>javax.json</groupId>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* MIT License
3+
*
4+
* Copyright (c) 2024-2025. Artem Getmanskii
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
package io.github.artemget.entrys.func;
26+
27+
import io.github.artemget.entrys.EntryException;
28+
import org.cactoos.BiFunc;
29+
30+
/**
31+
* Binary function with concrete entry exception.
32+
*
33+
* @param <X> Type of input
34+
* @param <Y> Type of input
35+
* @param <Z> Type of output
36+
* @since 0.4.2
37+
*/
38+
public interface EBiFunc<X, Y, Z> extends BiFunc<X, Y, Z> {
39+
@Override
40+
Z apply(X first, Y second) throws EntryException;
41+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* MIT License
3+
*
4+
* Copyright (c) 2024-2025. Artem Getmanskii
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
package io.github.artemget.entrys.func;
26+
27+
import io.github.artemget.entrys.EntryException;
28+
import org.cactoos.Func;
29+
30+
/**
31+
* Function with concrete entry exception.
32+
*
33+
* @param <X> Type of input
34+
* @param <Y> Type of output
35+
* @since 0.4.2
36+
*/
37+
public interface EFunc<X, Y> extends Func<X, Y> {
38+
@Override
39+
Y apply(X input) throws EntryException;
40+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* MIT License
3+
*
4+
* Copyright (c) 2024-2025. Artem Getmanskii
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
/**
26+
* Entry functions.
27+
*/
28+
package io.github.artemget.entrys.func;

0 commit comments

Comments
 (0)