diff --git a/README.md b/README.md index 54f0fcf..2a6d8f4 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,31 @@ This library is distributed via [jitpack.io](https://jitpack.io/#ArtemGet/entrys 1) Properties passed via -D 2) Environment variables -3) Json strings +3) Json strings + +Note that using json entries requires additional dependencies: + +```xml + + + org.glassfish + jakarta.json + 1.1.6 + +``` + 4) Yaml files +Note that using yaml entries requires additional dependencies: + +```xml + + com.amihaiemil.web + eo-yaml + 8.0.6 + +``` + # Examples ## Properties: diff --git a/pom.xml b/pom.xml index 12158d5..f0e9fcd 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,7 @@ com.amihaiemil.web eo-yaml 8.0.6 + provided javax.json diff --git a/src/main/java/io/github/artemget/entrys/func/EBiFunc.java b/src/main/java/io/github/artemget/entrys/func/EBiFunc.java new file mode 100644 index 0000000..6a97b2c --- /dev/null +++ b/src/main/java/io/github/artemget/entrys/func/EBiFunc.java @@ -0,0 +1,41 @@ +/* + * MIT License + * + * Copyright (c) 2024-2025. Artem Getmanskii + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package io.github.artemget.entrys.func; + +import io.github.artemget.entrys.EntryException; +import org.cactoos.BiFunc; + +/** + * Binary function with concrete entry exception. + * + * @param Type of input + * @param Type of input + * @param Type of output + * @since 0.4.2 + */ +public interface EBiFunc extends BiFunc { + @Override + Z apply(X first, Y second) throws EntryException; +} diff --git a/src/main/java/io/github/artemget/entrys/func/EFunc.java b/src/main/java/io/github/artemget/entrys/func/EFunc.java new file mode 100644 index 0000000..7a66e4b --- /dev/null +++ b/src/main/java/io/github/artemget/entrys/func/EFunc.java @@ -0,0 +1,40 @@ +/* + * MIT License + * + * Copyright (c) 2024-2025. Artem Getmanskii + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package io.github.artemget.entrys.func; + +import io.github.artemget.entrys.EntryException; +import org.cactoos.Func; + +/** + * Function with concrete entry exception. + * + * @param Type of input + * @param Type of output + * @since 0.4.2 + */ +public interface EFunc extends Func { + @Override + Y apply(X input) throws EntryException; +} diff --git a/src/main/java/io/github/artemget/entrys/func/package-info.java b/src/main/java/io/github/artemget/entrys/func/package-info.java new file mode 100644 index 0000000..3e6f3a7 --- /dev/null +++ b/src/main/java/io/github/artemget/entrys/func/package-info.java @@ -0,0 +1,28 @@ +/* + * MIT License + * + * Copyright (c) 2024-2025. Artem Getmanskii + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/** + * Entry functions. + */ +package io.github.artemget.entrys.func;