├── gradle
├── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
└── LICENSE_HEADER
├── .gitbugtraq
├── .idea
├── encodings.xml
├── vcs.xml
├── externalDependencies.xml
├── kotlinc.xml
├── kotlinScripting.xml
├── copyright
│ └── Apache_2_0.xml
└── .gitignore
├── subprojects
├── api
│ ├── pl.tlinkowski.unij.api
│ │ ├── src
│ │ │ ├── test
│ │ │ │ ├── resources
│ │ │ │ │ └── META-INF
│ │ │ │ │ │ └── services
│ │ │ │ │ │ ├── pl.tlinkowski.unij.api.UniJLoaderSpec$UnannotatedService
│ │ │ │ │ │ ├── pl.tlinkowski.unij.api.UniJLoaderSpec$DifferentPriorityService
│ │ │ │ │ │ └── pl.tlinkowski.unij.api.UniJLoaderSpec$DuplicatePriorityService
│ │ │ │ └── groovy
│ │ │ │ │ └── pl
│ │ │ │ │ └── tlinkowski
│ │ │ │ │ └── unij
│ │ │ │ │ └── api
│ │ │ │ │ ├── UniSetsSpec.groovy
│ │ │ │ │ ├── UniListsSpec.groovy
│ │ │ │ │ ├── UniJLoaderSpec.groovy
│ │ │ │ │ ├── UniMapsSpec.groovy
│ │ │ │ │ └── UniCollectorsSpec.groovy
│ │ │ ├── main
│ │ │ │ └── java
│ │ │ │ │ ├── pl
│ │ │ │ │ └── tlinkowski
│ │ │ │ │ │ └── unij
│ │ │ │ │ │ └── api
│ │ │ │ │ │ ├── package-info.java
│ │ │ │ │ │ ├── UniJException.java
│ │ │ │ │ │ ├── UniJ.java
│ │ │ │ │ │ ├── UniCollectors.java
│ │ │ │ │ │ ├── UniJLoader.java
│ │ │ │ │ │ ├── UniSets.java
│ │ │ │ │ │ └── UniLists.java
│ │ │ │ │ └── module-info.java
│ │ │ └── jmh
│ │ │ │ └── java
│ │ │ │ └── pl
│ │ │ │ └── tlinkowski
│ │ │ │ └── unij
│ │ │ │ └── api
│ │ │ │ └── UniListsBenchmark.java
│ │ └── pl.tlinkowski.unij.api.gradle.kts
│ └── pl.tlinkowski.unij.service.api
│ │ ├── pl.tlinkowski.unij.service.api.gradle.kts
│ │ └── src
│ │ └── main
│ │ └── java
│ │ ├── pl
│ │ └── tlinkowski
│ │ │ └── unij
│ │ │ └── service
│ │ │ └── api
│ │ │ ├── package-info.java
│ │ │ ├── collect
│ │ │ ├── package-info.java
│ │ │ ├── UnmodifiableSetFactory.java
│ │ │ └── UnmodifiableListFactory.java
│ │ │ ├── misc
│ │ │ ├── package-info.java
│ │ │ └── MiscellaneousApiProvider.java
│ │ │ └── UniJService.java
│ │ └── module-info.java
├── bindings
│ ├── misc
│ │ ├── pl.tlinkowski.unij.service.misc.jdk8
│ │ │ ├── pl.tlinkowski.unij.service.misc.jdk8.gradle.kts
│ │ │ └── src
│ │ │ │ ├── main
│ │ │ │ └── java
│ │ │ │ │ ├── pl
│ │ │ │ │ └── tlinkowski
│ │ │ │ │ │ └── unij
│ │ │ │ │ │ └── service
│ │ │ │ │ │ └── misc
│ │ │ │ │ │ └── jdk8
│ │ │ │ │ │ ├── package-info.java
│ │ │ │ │ │ └── Jdk8MiscellaneousApiProvider.java
│ │ │ │ │ └── module-info.java
│ │ │ │ └── test
│ │ │ │ └── groovy
│ │ │ │ └── pl
│ │ │ │ └── tlinkowski
│ │ │ │ └── unij
│ │ │ │ └── service
│ │ │ │ └── misc
│ │ │ │ └── jdk8
│ │ │ │ └── Jdk8MiscellaneousApiProviderSpec.groovy
│ │ └── pl.tlinkowski.unij.service.misc.jdk11
│ │ │ ├── pl.tlinkowski.unij.service.misc.jdk11.gradle.kts
│ │ │ └── src
│ │ │ ├── main
│ │ │ └── java
│ │ │ │ ├── pl
│ │ │ │ └── tlinkowski
│ │ │ │ │ └── unij
│ │ │ │ │ └── service
│ │ │ │ │ └── misc
│ │ │ │ │ └── jdk11
│ │ │ │ │ ├── package-info.java
│ │ │ │ │ └── Jdk11MiscellaneousApiProvider.java
│ │ │ │ └── module-info.java
│ │ │ └── test
│ │ │ └── groovy
│ │ │ └── pl
│ │ │ └── tlinkowski
│ │ │ └── unij
│ │ │ └── service
│ │ │ └── misc
│ │ │ └── jdk11
│ │ │ └── Jdk11MiscellaneousApiProviderSpec.groovy
│ └── collect
│ │ ├── pl.tlinkowski.unij.service.collect.jdk10
│ │ ├── pl.tlinkowski.unij.service.collect.jdk10.gradle.kts
│ │ └── src
│ │ │ ├── main
│ │ │ └── java
│ │ │ │ ├── pl
│ │ │ │ └── tlinkowski
│ │ │ │ │ └── unij
│ │ │ │ │ └── service
│ │ │ │ │ └── collect
│ │ │ │ │ └── jdk10
│ │ │ │ │ ├── package-info.java
│ │ │ │ │ ├── Jdk10UnmodifiableSetFactory.java
│ │ │ │ │ └── Jdk10UnmodifiableListFactory.java
│ │ │ │ └── module-info.java
│ │ │ └── test
│ │ │ └── groovy
│ │ │ └── pl
│ │ │ └── tlinkowski
│ │ │ └── unij
│ │ │ └── service
│ │ │ └── collect
│ │ │ └── jdk10
│ │ │ ├── Jdk10UnmodifiableMapFactorySpec.groovy
│ │ │ ├── Jdk10UnmodifiableSetFactorySpec.groovy
│ │ │ └── Jdk10UnmodifiableListFactorySpec.groovy
│ │ ├── pl.tlinkowski.unij.service.collect.jdk8
│ │ ├── pl.tlinkowski.unij.service.collect.jdk8.gradle.kts
│ │ └── src
│ │ │ ├── main
│ │ │ └── java
│ │ │ │ ├── pl
│ │ │ │ └── tlinkowski
│ │ │ │ │ └── unij
│ │ │ │ │ └── service
│ │ │ │ │ └── collect
│ │ │ │ │ └── jdk8
│ │ │ │ │ └── package-info.java
│ │ │ │ └── module-info.java
│ │ │ └── test
│ │ │ └── groovy
│ │ │ └── pl
│ │ │ └── tlinkowski
│ │ │ └── unij
│ │ │ └── service
│ │ │ └── collect
│ │ │ └── jdk8
│ │ │ ├── Jdk8UnmodifiableMapFactorySpec.groovy
│ │ │ ├── Jdk8UnmodifiableSetFactorySpec.groovy
│ │ │ └── Jdk8UnmodifiableListFactorySpec.groovy
│ │ ├── pl.tlinkowski.unij.service.collect.guava
│ │ ├── pl.tlinkowski.unij.service.collect.guava.gradle.kts
│ │ └── src
│ │ │ ├── main
│ │ │ └── java
│ │ │ │ ├── pl
│ │ │ │ └── tlinkowski
│ │ │ │ │ └── unij
│ │ │ │ │ └── service
│ │ │ │ │ └── collect
│ │ │ │ │ └── guava
│ │ │ │ │ ├── package-info.java
│ │ │ │ │ ├── GuavaUnmodifiableListFactory.java
│ │ │ │ │ └── GuavaUnmodifiableSetFactory.java
│ │ │ │ └── module-info.java
│ │ │ └── test
│ │ │ └── groovy
│ │ │ └── pl
│ │ │ └── tlinkowski
│ │ │ └── unij
│ │ │ └── service
│ │ │ └── collect
│ │ │ └── guava
│ │ │ ├── GuavaUnmodifiableMapFactorySpec.groovy
│ │ │ ├── GuavaUnmodifiableSetFactorySpec.groovy
│ │ │ └── GuavaUnmodifiableListFactorySpec.groovy
│ │ └── pl.tlinkowski.unij.service.collect.eclipse
│ │ ├── src
│ │ ├── main
│ │ │ └── java
│ │ │ │ ├── pl
│ │ │ │ └── tlinkowski
│ │ │ │ │ └── unij
│ │ │ │ │ └── service
│ │ │ │ │ └── collect
│ │ │ │ │ └── eclipse
│ │ │ │ │ └── package-info.java
│ │ │ │ └── module-info.java
│ │ └── test
│ │ │ └── groovy
│ │ │ └── pl
│ │ │ └── tlinkowski
│ │ │ └── unij
│ │ │ └── service
│ │ │ └── collect
│ │ │ └── eclipse
│ │ │ ├── EclipseUnmodifiableMapFactorySpec.groovy
│ │ │ ├── EclipseUnmodifiableSetFactorySpec.groovy
│ │ │ └── EclipseUnmodifiableListFactorySpec.groovy
│ │ └── pl.tlinkowski.unij.service.collect.eclipse.gradle.kts
├── samples
│ ├── lib
│ │ ├── pl.tlinkowski.unij.sample.lib
│ │ │ ├── pl.tlinkowski.unij.sample.lib.gradle.kts
│ │ │ └── src
│ │ │ │ ├── main
│ │ │ │ └── java
│ │ │ │ │ ├── pl
│ │ │ │ │ └── tlinkowski
│ │ │ │ │ │ └── unij
│ │ │ │ │ │ └── sample
│ │ │ │ │ │ └── lib
│ │ │ │ │ │ ├── package-info.java
│ │ │ │ │ │ └── SampleLogic.java
│ │ │ │ │ └── module-info.java
│ │ │ │ └── test
│ │ │ │ └── groovy
│ │ │ │ └── pl
│ │ │ │ └── tlinkowski
│ │ │ │ └── unij
│ │ │ │ └── sample
│ │ │ │ └── lib
│ │ │ │ └── SampleLogicSpec.groovy
│ │ ├── pl.tlinkowski.unij.sample.lib.usage.jdk8
│ │ │ ├── src
│ │ │ │ ├── main
│ │ │ │ │ └── java
│ │ │ │ │ │ ├── pl
│ │ │ │ │ │ └── tlinkowski
│ │ │ │ │ │ │ └── unij
│ │ │ │ │ │ │ └── sample
│ │ │ │ │ │ │ └── lib
│ │ │ │ │ │ │ └── usage
│ │ │ │ │ │ │ └── jdk8
│ │ │ │ │ │ │ ├── package-info.java
│ │ │ │ │ │ │ └── SampleLogicMain.java
│ │ │ │ │ │ └── module-info.java
│ │ │ │ └── test
│ │ │ │ │ └── groovy
│ │ │ │ │ └── pl
│ │ │ │ │ └── tlinkowski
│ │ │ │ │ └── unij
│ │ │ │ │ └── sample
│ │ │ │ │ └── lib
│ │ │ │ │ └── usage
│ │ │ │ │ └── jdk8
│ │ │ │ │ └── SampleLogicSpec.groovy
│ │ │ └── pl.tlinkowski.unij.sample.lib.usage.jdk8.gradle.kts
│ │ ├── pl.tlinkowski.unij.sample.lib.usage.guava
│ │ │ ├── src
│ │ │ │ ├── main
│ │ │ │ │ └── java
│ │ │ │ │ │ ├── pl
│ │ │ │ │ │ └── tlinkowski
│ │ │ │ │ │ │ └── unij
│ │ │ │ │ │ │ └── sample
│ │ │ │ │ │ │ └── lib
│ │ │ │ │ │ │ └── usage
│ │ │ │ │ │ │ └── guava
│ │ │ │ │ │ │ ├── package-info.java
│ │ │ │ │ │ │ └── SampleLogicMain.java
│ │ │ │ │ │ └── module-info.java
│ │ │ │ └── test
│ │ │ │ │ └── groovy
│ │ │ │ │ └── pl
│ │ │ │ │ └── tlinkowski
│ │ │ │ │ └── unij
│ │ │ │ │ └── sample
│ │ │ │ │ └── lib
│ │ │ │ │ └── usage
│ │ │ │ │ └── guava
│ │ │ │ │ └── SampleLogicSpec.groovy
│ │ │ └── pl.tlinkowski.unij.sample.lib.usage.guava.gradle.kts
│ │ ├── pl.tlinkowski.unij.sample.lib.usage.jdk11
│ │ │ ├── src
│ │ │ │ ├── main
│ │ │ │ │ └── java
│ │ │ │ │ │ ├── pl
│ │ │ │ │ │ └── tlinkowski
│ │ │ │ │ │ │ └── unij
│ │ │ │ │ │ │ └── sample
│ │ │ │ │ │ │ └── lib
│ │ │ │ │ │ │ └── usage
│ │ │ │ │ │ │ └── jdk11
│ │ │ │ │ │ │ ├── package-info.java
│ │ │ │ │ │ │ └── SampleLogicMain.java
│ │ │ │ │ │ └── module-info.java
│ │ │ │ └── test
│ │ │ │ │ └── groovy
│ │ │ │ │ └── pl
│ │ │ │ │ └── tlinkowski
│ │ │ │ │ └── unij
│ │ │ │ │ └── sample
│ │ │ │ │ └── lib
│ │ │ │ │ └── usage
│ │ │ │ │ └── jdk11
│ │ │ │ │ └── SampleLogicSpec.groovy
│ │ │ └── pl.tlinkowski.unij.sample.lib.usage.jdk11.gradle.kts
│ │ └── pl.tlinkowski.unij.sample.lib.usage.eclipse
│ │ │ ├── src
│ │ │ ├── main
│ │ │ │ └── java
│ │ │ │ │ ├── pl
│ │ │ │ │ └── tlinkowski
│ │ │ │ │ │ └── unij
│ │ │ │ │ │ └── sample
│ │ │ │ │ │ └── lib
│ │ │ │ │ │ └── usage
│ │ │ │ │ │ └── eclipse
│ │ │ │ │ │ ├── package-info.java
│ │ │ │ │ │ └── SampleLogicMain.java
│ │ │ │ │ └── module-info.java
│ │ │ └── test
│ │ │ │ └── groovy
│ │ │ │ └── pl
│ │ │ │ └── tlinkowski
│ │ │ │ └── unij
│ │ │ │ └── sample
│ │ │ │ └── lib
│ │ │ │ └── usage
│ │ │ │ └── eclipse
│ │ │ │ └── SampleLogicSpec.groovy
│ │ │ └── pl.tlinkowski.unij.sample.lib.usage.eclipse.gradle.kts
│ └── enduser
│ │ ├── pl.tlinkowski.unij.sample.enduser.jdk11
│ │ ├── src
│ │ │ ├── main
│ │ │ │ └── java
│ │ │ │ │ ├── module-info.java
│ │ │ │ │ └── pl
│ │ │ │ │ └── tlinkowski
│ │ │ │ │ └── unij
│ │ │ │ │ └── sample
│ │ │ │ │ └── enduser
│ │ │ │ │ └── jdk11
│ │ │ │ │ ├── package-info.java
│ │ │ │ │ └── EndUsage.java
│ │ │ └── test
│ │ │ │ └── groovy
│ │ │ │ └── pl
│ │ │ │ └── tlinkowski
│ │ │ │ └── unij
│ │ │ │ └── sample
│ │ │ │ └── enduser
│ │ │ │ └── jdk11
│ │ │ │ └── EndUsageSpec.groovy
│ │ └── pl.tlinkowski.unij.sample.enduser.jdk11.gradle.kts
│ │ └── pl.tlinkowski.unij.sample.enduser.jdk8
│ │ ├── src
│ │ ├── main
│ │ │ └── java
│ │ │ │ ├── module-info.java
│ │ │ │ └── pl
│ │ │ │ └── tlinkowski
│ │ │ │ └── unij
│ │ │ │ └── sample
│ │ │ │ └── enduser
│ │ │ │ └── jdk8
│ │ │ │ ├── package-info.java
│ │ │ │ └── EndUsage.java
│ │ └── test
│ │ │ └── groovy
│ │ │ └── pl
│ │ │ └── tlinkowski
│ │ │ └── unij
│ │ │ └── sample
│ │ │ └── enduser
│ │ │ └── jdk8
│ │ │ └── EndUsageSpec.groovy
│ │ └── pl.tlinkowski.unij.sample.enduser.jdk8.gradle.kts
├── pl.tlinkowski.unij.test
│ ├── src
│ │ └── main
│ │ │ └── groovy
│ │ │ └── pl
│ │ │ └── tlinkowski
│ │ │ └── unij
│ │ │ └── test
│ │ │ ├── bundle
│ │ │ ├── package-info.java
│ │ │ └── UniJBundleTest.groovy
│ │ │ └── service
│ │ │ ├── collect
│ │ │ ├── package-info.java
│ │ │ └── UnmodifiableCollectionSpecHelper.groovy
│ │ │ └── misc
│ │ │ └── MiscellaneousApiProviderSpec.groovy
│ └── pl.tlinkowski.unij.test.gradle.kts
└── bundles
│ ├── pl.tlinkowski.unij.bundle.jdk8
│ ├── pl.tlinkowski.unij.bundle.jdk8.gradle.kts
│ └── src
│ │ ├── test
│ │ └── groovy
│ │ │ └── pl
│ │ │ └── tlinkowski
│ │ │ └── unij
│ │ │ └── bundle
│ │ │ └── jdk8
│ │ │ └── Jdk8BundleTest.groovy
│ │ └── main
│ │ └── java
│ │ └── module-info.java
│ ├── pl.tlinkowski.unij.bundle.jdk11
│ ├── pl.tlinkowski.unij.bundle.jdk11.gradle.kts
│ └── src
│ │ ├── test
│ │ └── groovy
│ │ │ └── pl
│ │ │ └── tlinkowski
│ │ │ └── unij
│ │ │ └── bundle
│ │ │ └── jdk11
│ │ │ └── Jdk11BundleTest.groovy
│ │ └── main
│ │ └── java
│ │ └── module-info.java
│ ├── pl.tlinkowski.unij.bundle.guava_jdk8
│ ├── src
│ │ ├── test
│ │ │ └── groovy
│ │ │ │ └── pl
│ │ │ │ └── tlinkowski
│ │ │ │ └── unij
│ │ │ │ └── bundle
│ │ │ │ └── guava_jdk8
│ │ │ │ └── GuavaJdk8BundleTest.groovy
│ │ └── main
│ │ │ └── java
│ │ │ └── module-info.java
│ └── pl.tlinkowski.unij.bundle.guava_jdk8.gradle.kts
│ └── pl.tlinkowski.unij.bundle.eclipse_jdk8
│ ├── src
│ ├── test
│ │ └── groovy
│ │ │ └── pl
│ │ │ └── tlinkowski
│ │ │ └── unij
│ │ │ └── bundle
│ │ │ └── eclipse_jdk8
│ │ │ └── EclipseJdk8BundleTest.groovy
│ └── main
│ │ └── java
│ │ └── module-info.java
│ └── pl.tlinkowski.unij.bundle.eclipse_jdk8.gradle.kts
├── .gitignore
├── .travis.yml
├── gradle.properties
├── .appveyor.yml
├── docs
├── UniListsBenchmark-results.txt
└── EXTRA.md
├── settings.gradle.kts
├── lombok.config
├── gradlew.bat
└── CHANGELOG.md
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tlinkowski/UniJ/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/.gitbugtraq:
--------------------------------------------------------------------------------
1 | [bugtraq]
2 | url = https://github.com/tlinkowski/UniJ/issues/%BUGID%
3 | loglinkregex = "#\\d+"
4 | logregex = \\d+
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/test/resources/META-INF/services/pl.tlinkowski.unij.api.UniJLoaderSpec$UnannotatedService:
--------------------------------------------------------------------------------
1 | pl.tlinkowski.unij.api.UniJLoaderSpec$UnannotatedServiceImpl
2 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/externalDependencies.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/kotlinScripting.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/test/resources/META-INF/services/pl.tlinkowski.unij.api.UniJLoaderSpec$DifferentPriorityService:
--------------------------------------------------------------------------------
1 | pl.tlinkowski.unij.api.UniJLoaderSpec$DifferentPriorityServiceImpl1
2 | pl.tlinkowski.unij.api.UniJLoaderSpec$DifferentPriorityServiceImpl2
3 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/test/resources/META-INF/services/pl.tlinkowski.unij.api.UniJLoaderSpec$DuplicatePriorityService:
--------------------------------------------------------------------------------
1 | pl.tlinkowski.unij.api.UniJLoaderSpec$DuplicatePriorityServiceImpl1
2 | pl.tlinkowski.unij.api.UniJLoaderSpec$DuplicatePriorityServiceImpl2
3 |
--------------------------------------------------------------------------------
/gradle/LICENSE_HEADER:
--------------------------------------------------------------------------------
1 | SPDX-License-Identifier: Apache-2.0
2 |
3 | Copyright ${copyrightYear} ${author}.
4 |
5 | Licensed under the Apache License, Version 2.0 (the "License");
6 | you may not use this file except in compliance with the License.
7 | You may obtain a copy of the License at
8 |
9 | http://www.apache.org/licenses/LICENSE-2.0
10 |
11 | Unless required by applicable law or agreed to in writing, software
12 | distributed under the License is distributed on an "AS IS" BASIS,
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | See the License for the specific language governing permissions and
15 | limitations under the License.
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 |
7 | # BlueJ files
8 | *.ctxt
9 |
10 | # Mobile Tools for Java (J2ME)
11 | .mtj.tmp/
12 |
13 | # Package Files #
14 | *.jar
15 | *.war
16 | *.nar
17 | *.ear
18 | *.zip
19 | *.tar.gz
20 | *.rar
21 |
22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23 | hs_err_pid*
24 |
25 | #
26 | # Gradle
27 | #
28 | .gradle
29 | build/
30 |
31 | # Ignore Gradle GUI config
32 | gradle-app.setting
33 |
34 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
35 | !gradle-wrapper.jar
36 |
37 | #
38 | # IntelliJ
39 | #
40 | *.iml
41 |
42 | #
43 | # Node.js
44 | #
45 | /node_modules/
46 | /package-lock.json
47 |
48 | #
49 | # SuperPOM
50 | #
51 | /.grenrc.yml
52 | /package.json
53 | /release.bat
54 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.service.api/pl.tlinkowski.unij.service.api.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.mixedJavaRelease(8)
19 |
--------------------------------------------------------------------------------
/subprojects/bindings/misc/pl.tlinkowski.unij.service.misc.jdk8/pl.tlinkowski.unij.service.misc.jdk8.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.mixedJavaRelease(8)
19 |
--------------------------------------------------------------------------------
/subprojects/bindings/misc/pl.tlinkowski.unij.service.misc.jdk11/pl.tlinkowski.unij.service.misc.jdk11.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.standardJavaRelease(11)
19 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk10/pl.tlinkowski.unij.service.collect.jdk10.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.standardJavaRelease(10)
19 |
--------------------------------------------------------------------------------
/.idea/copyright/Apache_2_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk8/pl.tlinkowski.unij.service.collect.jdk8.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.mixedJavaRelease(8)
19 |
20 | superpom.useLombok = true
21 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | jdk: openjdk12
3 |
4 | sudo: false # faster builds
5 |
6 | branches:
7 | except:
8 | - /^\d+\.\d+\.\d+$/ # skip builds related to addTemporaryVersionTag
9 |
10 | before_install:
11 | - chmod +x gradlew # https://stackoverflow.com/questions/33820638/travis-yml-gradlew-permission-denied/33820642#33820642
12 | - pip install --user codecov # https://github.com/codecov/codecov-python#configuration
13 |
14 | #region https://docs.travis-ci.com/user/languages/java/#caching
15 | before_cache:
16 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
17 | - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
18 | cache:
19 | directories:
20 | - $HOME/.gradle/caches/
21 | - $HOME/.gradle/wrapper/
22 | #endregion
23 |
24 | script:
25 | - ./gradlew check --stacktrace
26 |
27 | after_success:
28 | - codecov # https://github.com/codecov/codecov-python#configuration
29 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib/pl.tlinkowski.unij.sample.lib.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.mixedJavaRelease(8)
19 |
20 | dependencies {
21 | implementation(project(":pl.tlinkowski.unij.api"))
22 | }
23 |
--------------------------------------------------------------------------------
/subprojects/pl.tlinkowski.unij.test/src/main/groovy/pl/tlinkowski/unij/test/bundle/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | @NonNullPackage
22 | package pl.tlinkowski.unij.test.bundle;
23 |
24 | import pl.tlinkowski.annotation.basic.NonNullPackage;
25 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib/src/main/java/pl/tlinkowski/unij/sample/lib/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | @NonNullPackage
22 | package pl.tlinkowski.unij.sample.lib;
23 |
24 | import pl.tlinkowski.annotation.basic.NonNullPackage;
25 |
--------------------------------------------------------------------------------
/subprojects/bundles/pl.tlinkowski.unij.bundle.jdk8/pl.tlinkowski.unij.bundle.jdk8.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.mixedJavaRelease(8)
19 |
20 | dependencies {
21 | implementation(project(":pl.tlinkowski.unij.service.collect.jdk8"))
22 | implementation(project(":pl.tlinkowski.unij.service.misc.jdk8"))
23 | }
24 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/main/java/pl/tlinkowski/unij/api/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * UniJ API for the end users.
20 | *
21 | * @author Tomasz Linkowski
22 | */
23 | @NonNullPackage
24 | package pl.tlinkowski.unij.api;
25 |
26 | import pl.tlinkowski.annotation.basic.NonNullPackage;
27 |
--------------------------------------------------------------------------------
/subprojects/samples/enduser/pl.tlinkowski.unij.sample.enduser.jdk11/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | module pl.tlinkowski.unij.sample.enduser.jdk11 {
22 | requires pl.tlinkowski.unij.bundle.jdk11;
23 | requires static pl.tlinkowski.annotation.basic;
24 | }
25 |
--------------------------------------------------------------------------------
/subprojects/samples/enduser/pl.tlinkowski.unij.sample.enduser.jdk8/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | module pl.tlinkowski.unij.sample.enduser.jdk8 {
22 | requires pl.tlinkowski.unij.bundle.jdk8;
23 | requires static pl.tlinkowski.annotation.basic;
24 | }
25 |
--------------------------------------------------------------------------------
/subprojects/bundles/pl.tlinkowski.unij.bundle.jdk11/pl.tlinkowski.unij.bundle.jdk11.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.standardJavaRelease(11)
19 |
20 | dependencies {
21 | implementation(project(":pl.tlinkowski.unij.service.collect.jdk10"))
22 | implementation(project(":pl.tlinkowski.unij.service.misc.jdk11"))
23 | }
24 |
--------------------------------------------------------------------------------
/subprojects/samples/enduser/pl.tlinkowski.unij.sample.enduser.jdk8/src/main/java/pl/tlinkowski/unij/sample/enduser/jdk8/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | @NonNullPackage
22 | package pl.tlinkowski.unij.sample.enduser.jdk8;
23 |
24 | import pl.tlinkowski.annotation.basic.NonNullPackage;
25 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.jdk8/src/main/java/pl/tlinkowski/unij/sample/lib/usage/jdk8/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | @NonNullPackage
22 | package pl.tlinkowski.unij.sample.lib.usage.jdk8;
23 |
24 | import pl.tlinkowski.annotation.basic.NonNullPackage;
25 |
--------------------------------------------------------------------------------
/subprojects/samples/enduser/pl.tlinkowski.unij.sample.enduser.jdk11/src/main/java/pl/tlinkowski/unij/sample/enduser/jdk11/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | @NonNullPackage
22 | package pl.tlinkowski.unij.sample.enduser.jdk11;
23 |
24 | import pl.tlinkowski.annotation.basic.NonNullPackage;
25 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.guava/src/main/java/pl/tlinkowski/unij/sample/lib/usage/guava/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | @NonNullPackage
22 | package pl.tlinkowski.unij.sample.lib.usage.guava;
23 |
24 | import pl.tlinkowski.annotation.basic.NonNullPackage;
25 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.jdk11/src/main/java/pl/tlinkowski/unij/sample/lib/usage/jdk11/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | @NonNullPackage
22 | package pl.tlinkowski.unij.sample.lib.usage.jdk11;
23 |
24 | import pl.tlinkowski.annotation.basic.NonNullPackage;
25 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | module pl.tlinkowski.unij.sample.lib {
22 | exports pl.tlinkowski.unij.sample.lib;
23 |
24 | requires pl.tlinkowski.unij.api;
25 | requires static pl.tlinkowski.annotation.basic;
26 | }
27 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.eclipse/src/main/java/pl/tlinkowski/unij/sample/lib/usage/eclipse/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | @NonNullPackage
22 | package pl.tlinkowski.unij.sample.lib.usage.eclipse;
23 |
24 | import pl.tlinkowski.annotation.basic.NonNullPackage;
25 |
--------------------------------------------------------------------------------
/subprojects/bundles/pl.tlinkowski.unij.bundle.jdk8/src/test/groovy/pl/tlinkowski/unij/bundle/jdk8/Jdk8BundleTest.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.bundle.jdk8
19 |
20 | import pl.tlinkowski.unij.test.bundle.UniJBundleTest
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class Jdk8BundleTest extends UniJBundleTest {
26 | }
27 |
--------------------------------------------------------------------------------
/subprojects/bundles/pl.tlinkowski.unij.bundle.jdk11/src/test/groovy/pl/tlinkowski/unij/bundle/jdk11/Jdk11BundleTest.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.bundle.jdk11
19 |
20 | import pl.tlinkowski.unij.test.bundle.UniJBundleTest
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class Jdk11BundleTest extends UniJBundleTest {
26 | }
27 |
--------------------------------------------------------------------------------
/subprojects/bundles/pl.tlinkowski.unij.bundle.guava_jdk8/src/test/groovy/pl/tlinkowski/unij/bundle/guava_jdk8/GuavaJdk8BundleTest.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.bundle.guava_jdk8
19 |
20 | import pl.tlinkowski.unij.test.bundle.UniJBundleTest
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class GuavaJdk8BundleTest extends UniJBundleTest {
26 | }
27 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # SPDX-License-Identifier: Apache-2.0
3 | #
4 | # Copyright 2018-2019 Tomasz Linkowski.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 | group=pl.tlinkowski.unij
19 | # Release scopes: [major, minor, patch]
20 | reckon.scope=patch
21 | # Dependencies
22 | mySuperpomVersion=0.5.0
23 | basicAnnotationsVersion=0.2.0
24 | slf4jVersion=1.7.28
25 | autoServiceVersion=1.0-rc6
26 | guavaLowVersion=23.2-jre
27 | guavaHighVersion=28.1-jre
28 | eclipseCollectionsLowVersion=9.0.0
29 | eclipseCollectionsHighVersion=10.0.0
30 |
--------------------------------------------------------------------------------
/subprojects/bundles/pl.tlinkowski.unij.bundle.eclipse_jdk8/src/test/groovy/pl/tlinkowski/unij/bundle/eclipse_jdk8/EclipseJdk8BundleTest.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.bundle.eclipse_jdk8
19 |
20 | import pl.tlinkowski.unij.test.bundle.UniJBundleTest
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class EclipseJdk8BundleTest extends UniJBundleTest {
26 | }
27 |
--------------------------------------------------------------------------------
/subprojects/bindings/misc/pl.tlinkowski.unij.service.misc.jdk8/src/main/java/pl/tlinkowski/unij/service/misc/jdk8/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * UniJ miscellaneous service implementations based on JDK 8.
20 | *
21 | * @author Tomasz Linkowski
22 | */
23 | @NonNullPackage
24 | package pl.tlinkowski.unij.service.misc.jdk8;
25 |
26 | import pl.tlinkowski.annotation.basic.NonNullPackage;
27 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/main/java/pl/tlinkowski/unij/api/UniJException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.api;
19 |
20 | /**
21 | * Dedicated unchecked exception for UniJ.
22 | *
23 | * @author Tomasz Linkowski
24 | */
25 | public class UniJException extends RuntimeException {
26 |
27 | public UniJException(String message) {
28 | super(message);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.service.api/src/main/java/pl/tlinkowski/unij/service/api/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * API for UniJ services (e.g. {@link pl.tlinkowski.unij.service.api.UniJService} annotation).
20 | *
21 | * @author Tomasz Linkowski
22 | */
23 | @NonNullPackage
24 | package pl.tlinkowski.unij.service.api;
25 |
26 | import pl.tlinkowski.annotation.basic.NonNullPackage;
27 |
--------------------------------------------------------------------------------
/subprojects/bindings/misc/pl.tlinkowski.unij.service.misc.jdk11/src/main/java/pl/tlinkowski/unij/service/misc/jdk11/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * UniJ miscellaneous service implementations based on JDK 11.
20 | *
21 | * @author Tomasz Linkowski
22 | */
23 | @NonNullPackage
24 | package pl.tlinkowski.unij.service.misc.jdk11;
25 |
26 | import pl.tlinkowski.annotation.basic.NonNullPackage;
27 |
--------------------------------------------------------------------------------
/.appveyor.yml:
--------------------------------------------------------------------------------
1 | # reference: https://www.appveyor.com/docs/appveyor-yml/
2 |
3 | image: Visual Studio 2017 # https://www.appveyor.com/docs/windows-images-software/
4 |
5 | version: "#{build} ({branch})"
6 |
7 | branches:
8 | except:
9 | - /^\d+\.\d+\.\d+$/ # skip builds related to addTemporaryVersionTag
10 |
11 | #region JAVA
12 | environment:
13 | matrix:
14 | - JAVA_HOME: C:\Program Files\Java\jdk12
15 |
16 | install:
17 | - SET PATH=%JAVA_HOME%\bin;%PATH
18 | - java --version
19 | #endregion
20 |
21 | #region GRADLE
22 | build_script:
23 | - gradlew.bat assemble
24 |
25 | test_script:
26 | - gradlew.bat check --stacktrace
27 |
28 | cache:
29 | - C:\Users\appveyor\.gradle
30 |
31 | on_finish:
32 | # upload test results via REST-api: https://github.com/appveyor/ci/issues/92#issuecomment-307242316
33 | - ps: |
34 | $wc = New-Object 'System.Net.WebClient'
35 | Get-ChildItem . -Name -Recurse 'TEST-*.xml' |
36 | Foreach-Object {
37 | $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $_))
38 | }
39 | #endregion
40 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.service.api/src/main/java/pl/tlinkowski/unij/service/api/collect/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * UniJ {@link java.util.Collection}-factory service interfaces.
20 | *
21 | * @author Tomasz Linkowski
22 | * @see java.util.ServiceLoader
23 | */
24 | @NonNullPackage
25 | package pl.tlinkowski.unij.service.api.collect;
26 |
27 | import pl.tlinkowski.annotation.basic.NonNullPackage;
28 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.jdk8/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | module pl.tlinkowski.unij.sample.lib.usage.jdk8 {
22 | requires pl.tlinkowski.unij.sample.lib;
23 |
24 | requires pl.tlinkowski.unij.service.collect.jdk8;
25 | requires pl.tlinkowski.unij.service.misc.jdk8;
26 |
27 | requires static pl.tlinkowski.annotation.basic;
28 | }
29 |
--------------------------------------------------------------------------------
/subprojects/pl.tlinkowski.unij.test/src/main/groovy/pl/tlinkowski/unij/test/service/collect/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * Test classes (specifications) for UniJ {@link java.util.Collection}-factory services.
20 | *
21 | * @author Tomasz Linkowski
22 | * @see java.util.ServiceLoader
23 | */
24 | @NonNullPackage
25 | package pl.tlinkowski.unij.test.service.collect;
26 |
27 | import pl.tlinkowski.annotation.basic.NonNullPackage;
28 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.guava/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | module pl.tlinkowski.unij.sample.lib.usage.guava {
22 | requires pl.tlinkowski.unij.sample.lib;
23 |
24 | requires pl.tlinkowski.unij.service.collect.guava;
25 | requires pl.tlinkowski.unij.service.misc.jdk8;
26 |
27 | requires static pl.tlinkowski.annotation.basic;
28 | }
29 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.jdk11/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | module pl.tlinkowski.unij.sample.lib.usage.jdk11 {
22 | requires pl.tlinkowski.unij.sample.lib;
23 |
24 | requires pl.tlinkowski.unij.service.collect.jdk10;
25 | requires pl.tlinkowski.unij.service.misc.jdk11;
26 |
27 | requires static pl.tlinkowski.annotation.basic;
28 | }
29 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.eclipse/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * @author Tomasz Linkowski
20 | */
21 | module pl.tlinkowski.unij.sample.lib.usage.eclipse {
22 | requires pl.tlinkowski.unij.sample.lib;
23 |
24 | requires pl.tlinkowski.unij.service.collect.eclipse;
25 | requires pl.tlinkowski.unij.service.misc.jdk8;
26 |
27 | requires static pl.tlinkowski.annotation.basic;
28 | }
29 |
--------------------------------------------------------------------------------
/docs/UniListsBenchmark-results.txt:
--------------------------------------------------------------------------------
1 | # VM version: JDK 11.0.1, OpenJDK 64-Bit Server VM, 11.0.1+13
2 | # Warmup: 5 iterations, 10 s each
3 | # Measurement: 5 iterations, 10 s each
4 |
5 | Benchmark Mode Cnt Score Error Units
6 |
7 | UniListsBenchmark.listOf avgt 25 3,690 ± 0,243 ns/op
8 | UniListsBenchmark.uniListsOf avgt 25 3,880 ± 0,176 ns/op
9 |
10 | UniListsBenchmark.listOf1 avgt 25 5,527 ± 0,073 ns/op
11 | UniListsBenchmark.uniListsOf1 avgt 25 6,259 ± 0,139 ns/op
12 |
13 | UniListsBenchmark.listOf2 avgt 25 5,982 ± 0,034 ns/op
14 | UniListsBenchmark.uniListsOf2 avgt 25 6,944 ± 0,442 ns/op
15 |
16 | UniListsBenchmark.listOf3 avgt 25 14,634 ± 0,059 ns/op
17 | UniListsBenchmark.uniListsOf3 avgt 25 16,273 ± 0,173 ns/op
18 |
19 | UniListsBenchmark.listOf10 avgt 25 39,240 ± 0,153 ns/op
20 | UniListsBenchmark.uniListsOf10 avgt 25 38,438 ± 0,104 ns/op
21 |
22 | UniListsBenchmark.listOf20 avgt 25 74,388 ± 0,226 ns/op
23 | UniListsBenchmark.uniListsOf20 avgt 25 71,040 ± 0,209 ns/op
24 |
25 | # Run complete. Total time: 01:40:40
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | buildscript {
19 | repositories {
20 | mavenCentral()
21 | }
22 | dependencies {
23 | val mySuperpomVersion: String by settings // https://github.com/tlinkowski/tlinkowski-superpom
24 | classpath(group = "pl.tlinkowski.gradle.my", name = "pl.tlinkowski.gradle.my.settings", version = mySuperpomVersion)
25 | }
26 | }
27 | apply(plugin = "pl.tlinkowski.gradle.my.settings")
28 |
29 | rootProject.name = "UniJ"
30 |
--------------------------------------------------------------------------------
/subprojects/samples/enduser/pl.tlinkowski.unij.sample.enduser.jdk8/src/test/groovy/pl/tlinkowski/unij/sample/enduser/jdk8/EndUsageSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.enduser.jdk8
19 |
20 | import spock.lang.Specification
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class EndUsageSpec extends Specification {
26 |
27 | def names() {
28 | expect:
29 | EndUsage.names() == List.of("foo", "bar")
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/subprojects/samples/enduser/pl.tlinkowski.unij.sample.enduser.jdk11/src/test/groovy/pl/tlinkowski/unij/sample/enduser/jdk11/EndUsageSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.enduser.jdk11
19 |
20 | import spock.lang.Specification
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class EndUsageSpec extends Specification {
26 |
27 | def names() {
28 | expect:
29 | EndUsage.names() == List.of("foo", "bar")
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk8/src/main/java/pl/tlinkowski/unij/service/collect/jdk8/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * UniJ {@link java.util.Collection}-factory service implementations based on JDK 8.
20 | *
21 | * @author Tomasz Linkowski
22 | * @see java.util.ServiceLoader
23 | */
24 | @NonNullPackage
25 | package pl.tlinkowski.unij.service.collect.jdk8;
26 |
27 | import pl.tlinkowski.annotation.basic.NonNullPackage;
28 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Source: https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
2 |
3 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
4 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
5 |
6 | # User-specific stuff
7 | /workspace.xml
8 | /tasks.xml
9 | /usage.statistics.xml
10 | /dictionaries
11 | /shelf
12 |
13 | # Generated files
14 | /contentModel.xml
15 |
16 | # Sensitive or high-churn files
17 | /dataSources/
18 | /dataSources.ids
19 | /dataSources.local.xml
20 | /sqlDataSources.xml
21 | /dynamic.xml
22 | /uiDesigner.xml
23 | /dbnavigator.xml
24 |
25 | # Gradle
26 | /gradle.xml
27 | /libraries
28 |
29 | # Gradle and Maven with auto-import
30 | # When using Gradle or Maven with auto-import, you should exclude module files,
31 | # since they will be recreated, and may cause churn. Uncomment if using
32 | # auto-import.
33 | /modules.xml
34 | /*.iml
35 | /modules
36 |
37 | # IntelliJ
38 | out/
39 |
40 | # Other
41 | /compiler.xml
42 | /misc.xml
43 |
44 | # SuperPOM
45 | /codeStyles/
46 | /copyright/profiles_settings.xml
47 | /inspectionProfiles/
48 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk10/src/main/java/pl/tlinkowski/unij/service/collect/jdk10/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * UniJ {@link java.util.Collection}-factory service implementations based on JDK 10.
20 | *
21 | * @author Tomasz Linkowski
22 | * @see java.util.ServiceLoader
23 | */
24 | @NonNullPackage
25 | package pl.tlinkowski.unij.service.collect.jdk10;
26 |
27 | import pl.tlinkowski.annotation.basic.NonNullPackage;
28 |
--------------------------------------------------------------------------------
/subprojects/samples/enduser/pl.tlinkowski.unij.sample.enduser.jdk8/pl.tlinkowski.unij.sample.enduser.jdk8.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | plugins {
19 | application
20 | }
21 |
22 | application {
23 | mainClassName = "${project.name}/${project.name}.EndUsage"
24 | }
25 |
26 | modularity.mixedJavaRelease(8)
27 |
28 | dependencies {
29 | implementation(project(":pl.tlinkowski.unij.bundle.jdk8"))
30 | }
31 |
32 | tasks {
33 | check {
34 | dependsOn(run)
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.service.api/src/main/java/pl/tlinkowski/unij/service/api/misc/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * Miscellaneous UniJ service provider interfaces (e.g. {@link pl.tlinkowski.unij.service.api.misc.MiscellaneousApiProvider}).
20 | *
21 | * @author Tomasz Linkowski
22 | * @see java.util.ServiceLoader
23 | */
24 | @NonNullPackage
25 | package pl.tlinkowski.unij.service.api.misc;
26 |
27 | import pl.tlinkowski.annotation.basic.NonNullPackage;
28 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.guava/pl.tlinkowski.unij.service.collect.guava.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.mixedJavaRelease(8)
19 |
20 | superpom.useLombok = true
21 |
22 | dependencies {
23 | val guavaLowVersion: String by project // https://github.com/google/guava
24 |
25 | compileOnly(group = "com.google.guava", name = "guava", version = guavaLowVersion)
26 | testRuntimeOnly(group = "com.google.guava", name = "guava", version = guavaLowVersion)
27 | }
28 |
--------------------------------------------------------------------------------
/subprojects/bundles/pl.tlinkowski.unij.bundle.guava_jdk8/pl.tlinkowski.unij.bundle.guava_jdk8.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.mixedJavaRelease(8)
19 |
20 | dependencies {
21 | implementation(project(":pl.tlinkowski.unij.service.collect.guava"))
22 | implementation(project(":pl.tlinkowski.unij.service.misc.jdk8"))
23 |
24 | val guavaHighVersion: String by project // https://github.com/google/guava
25 | testRuntimeOnly(group = "com.google.guava", name = "guava", version = guavaHighVersion)
26 | }
27 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.guava/src/test/groovy/pl/tlinkowski/unij/sample/lib/usage/guava/SampleLogicSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.lib.usage.guava
19 |
20 | import spock.lang.Specification
21 |
22 | import pl.tlinkowski.unij.sample.lib.SampleLogic
23 |
24 | /**
25 | * @author Tomasz Linkowski
26 | */
27 | class SampleLogicSpec extends Specification {
28 |
29 | def foo() {
30 | expect:
31 | SampleLogic.fooBar() == 212
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.jdk11/src/test/groovy/pl/tlinkowski/unij/sample/lib/usage/jdk11/SampleLogicSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.lib.usage.jdk11
19 |
20 | import spock.lang.Specification
21 |
22 | import pl.tlinkowski.unij.sample.lib.SampleLogic
23 |
24 | /**
25 | * @author Tomasz Linkowski
26 | */
27 | class SampleLogicSpec extends Specification {
28 |
29 | def foo() {
30 | expect:
31 | SampleLogic.fooBar() == 212
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.jdk8/src/test/groovy/pl/tlinkowski/unij/sample/lib/usage/jdk8/SampleLogicSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.lib.usage.jdk8
19 |
20 | import spock.lang.Specification
21 |
22 | import pl.tlinkowski.unij.sample.lib.SampleLogic
23 |
24 | /**
25 | * @author Tomasz Linkowski
26 | */
27 | class SampleLogicSpec extends Specification {
28 |
29 | def foo() {
30 | expect:
31 | SampleLogic.fooBar() == 212
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.eclipse/src/test/groovy/pl/tlinkowski/unij/sample/lib/usage/eclipse/SampleLogicSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.lib.usage.eclipse
19 |
20 | import spock.lang.Specification
21 |
22 | import pl.tlinkowski.unij.sample.lib.SampleLogic
23 |
24 | /**
25 | * @author Tomasz Linkowski
26 | */
27 | class SampleLogicSpec extends Specification {
28 |
29 | def foo() {
30 | expect:
31 | SampleLogic.fooBar() == 212
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.guava/src/main/java/pl/tlinkowski/unij/service/collect/guava/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * UniJ {@link java.util.Collection}-factory service implementations based on
20 | * Guava.
21 | *
22 | * @author Tomasz Linkowski
23 | * @see java.util.ServiceLoader
24 | */
25 | @NonNullPackage
26 | package pl.tlinkowski.unij.service.collect.guava;
27 |
28 | import pl.tlinkowski.annotation.basic.NonNullPackage;
29 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.guava/src/main/java/pl/tlinkowski/unij/sample/lib/usage/guava/SampleLogicMain.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.lib.usage.guava;
19 |
20 | import pl.tlinkowski.unij.sample.lib.SampleLogic;
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | public final class SampleLogicMain {
26 |
27 | public static void main(String[] args) {
28 | System.out.println(SampleLogic.fooBar());
29 | }
30 |
31 | private SampleLogicMain() {
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.jdk11/src/main/java/pl/tlinkowski/unij/sample/lib/usage/jdk11/SampleLogicMain.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.lib.usage.jdk11;
19 |
20 | import pl.tlinkowski.unij.sample.lib.SampleLogic;
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | public final class SampleLogicMain {
26 |
27 | public static void main(String[] args) {
28 | System.out.println(SampleLogic.fooBar());
29 | }
30 |
31 | private SampleLogicMain() {
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.jdk8/src/main/java/pl/tlinkowski/unij/sample/lib/usage/jdk8/SampleLogicMain.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.lib.usage.jdk8;
19 |
20 | import pl.tlinkowski.unij.sample.lib.SampleLogic;
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | public final class SampleLogicMain {
26 |
27 | public static void main(String[] args) {
28 | System.out.println(SampleLogic.fooBar());
29 | }
30 |
31 | private SampleLogicMain() {
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk8/src/test/groovy/pl/tlinkowski/unij/service/collect/jdk8/Jdk8UnmodifiableMapFactorySpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.jdk8
19 |
20 | import pl.tlinkowski.unij.test.service.collect.UnmodifiableMapFactorySpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class Jdk8UnmodifiableMapFactorySpec extends UnmodifiableMapFactorySpec {
26 |
27 | def setupSpec() {
28 | factory = new Jdk8UnmodifiableMapFactory()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk8/src/test/groovy/pl/tlinkowski/unij/service/collect/jdk8/Jdk8UnmodifiableSetFactorySpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.jdk8
19 |
20 | import pl.tlinkowski.unij.test.service.collect.UnmodifiableSetFactorySpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class Jdk8UnmodifiableSetFactorySpec extends UnmodifiableSetFactorySpec {
26 |
27 | def setupSpec() {
28 | factory = new Jdk8UnmodifiableSetFactory()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bindings/misc/pl.tlinkowski.unij.service.misc.jdk11/src/test/groovy/pl/tlinkowski/unij/service/misc/jdk11/Jdk11MiscellaneousApiProviderSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.misc.jdk11
19 |
20 | import pl.tlinkowski.unij.test.service.misc.MiscellaneousApiProviderSpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class Jdk11MiscellaneousApiProviderSpec extends MiscellaneousApiProviderSpec {
26 |
27 | def setupSpec() {
28 | provider = new Jdk11MiscellaneousApiProvider()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bindings/misc/pl.tlinkowski.unij.service.misc.jdk8/src/test/groovy/pl/tlinkowski/unij/service/misc/jdk8/Jdk8MiscellaneousApiProviderSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.misc.jdk8
19 |
20 | import pl.tlinkowski.unij.test.service.misc.MiscellaneousApiProviderSpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class Jdk8MiscellaneousApiProviderSpec extends MiscellaneousApiProviderSpec {
26 |
27 | def setupSpec() {
28 | provider = new Jdk8MiscellaneousApiProvider()
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.eclipse/src/main/java/pl/tlinkowski/unij/sample/lib/usage/eclipse/SampleLogicMain.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.lib.usage.eclipse;
19 |
20 | import pl.tlinkowski.unij.sample.lib.SampleLogic;
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | public final class SampleLogicMain {
26 |
27 | public static void main(String[] args) {
28 | System.out.println(SampleLogic.fooBar());
29 | }
30 |
31 | private SampleLogicMain() {
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.guava/src/test/groovy/pl/tlinkowski/unij/service/collect/guava/GuavaUnmodifiableMapFactorySpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.guava
19 |
20 | import pl.tlinkowski.unij.test.service.collect.UnmodifiableMapFactorySpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class GuavaUnmodifiableMapFactorySpec extends UnmodifiableMapFactorySpec {
26 |
27 | def setupSpec() {
28 | factory = new GuavaUnmodifiableMapFactory()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.guava/src/test/groovy/pl/tlinkowski/unij/service/collect/guava/GuavaUnmodifiableSetFactorySpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.guava
19 |
20 | import pl.tlinkowski.unij.test.service.collect.UnmodifiableSetFactorySpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class GuavaUnmodifiableSetFactorySpec extends UnmodifiableSetFactorySpec {
26 |
27 | def setupSpec() {
28 | factory = new GuavaUnmodifiableSetFactory()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk10/src/test/groovy/pl/tlinkowski/unij/service/collect/jdk10/Jdk10UnmodifiableMapFactorySpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.jdk10
19 |
20 | import pl.tlinkowski.unij.test.service.collect.UnmodifiableMapFactorySpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class Jdk10UnmodifiableMapFactorySpec extends UnmodifiableMapFactorySpec {
26 |
27 | def setupSpec() {
28 | factory = new Jdk10UnmodifiableMapFactory()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk10/src/test/groovy/pl/tlinkowski/unij/service/collect/jdk10/Jdk10UnmodifiableSetFactorySpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.jdk10
19 |
20 | import pl.tlinkowski.unij.test.service.collect.UnmodifiableSetFactorySpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class Jdk10UnmodifiableSetFactorySpec extends UnmodifiableSetFactorySpec {
26 |
27 | def setupSpec() {
28 | factory = new Jdk10UnmodifiableSetFactory()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk8/src/test/groovy/pl/tlinkowski/unij/service/collect/jdk8/Jdk8UnmodifiableListFactorySpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.jdk8
19 |
20 | import pl.tlinkowski.unij.test.service.collect.UnmodifiableListFactorySpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class Jdk8UnmodifiableListFactorySpec extends UnmodifiableListFactorySpec {
26 |
27 | def setupSpec() {
28 | factory = new Jdk8UnmodifiableListFactory()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.eclipse/src/main/java/pl/tlinkowski/unij/service/collect/eclipse/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * UniJ {@link java.util.Collection}-factory service implementations based on
20 | * Eclipse Collections.
21 | *
22 | * @author Tomasz Linkowski
23 | * @see java.util.ServiceLoader
24 | */
25 | @NonNullPackage
26 | package pl.tlinkowski.unij.service.collect.eclipse;
27 |
28 | import pl.tlinkowski.annotation.basic.NonNullPackage;
29 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.guava/src/test/groovy/pl/tlinkowski/unij/service/collect/guava/GuavaUnmodifiableListFactorySpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.guava
19 |
20 | import pl.tlinkowski.unij.test.service.collect.UnmodifiableListFactorySpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class GuavaUnmodifiableListFactorySpec extends UnmodifiableListFactorySpec {
26 |
27 | def setupSpec() {
28 | factory = new GuavaUnmodifiableListFactory()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk10/src/test/groovy/pl/tlinkowski/unij/service/collect/jdk10/Jdk10UnmodifiableListFactorySpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.jdk10
19 |
20 | import pl.tlinkowski.unij.test.service.collect.UnmodifiableListFactorySpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class Jdk10UnmodifiableListFactorySpec extends UnmodifiableListFactorySpec {
26 |
27 | def setupSpec() {
28 | factory = new Jdk10UnmodifiableListFactory()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.eclipse/src/test/groovy/pl/tlinkowski/unij/service/collect/eclipse/EclipseUnmodifiableMapFactorySpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.eclipse
19 |
20 | import pl.tlinkowski.unij.test.service.collect.UnmodifiableMapFactorySpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class EclipseUnmodifiableMapFactorySpec extends UnmodifiableMapFactorySpec {
26 |
27 | def setupSpec() {
28 | factory = new EclipseUnmodifiableMapFactory()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.eclipse/src/test/groovy/pl/tlinkowski/unij/service/collect/eclipse/EclipseUnmodifiableSetFactorySpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.eclipse
19 |
20 | import pl.tlinkowski.unij.test.service.collect.UnmodifiableSetFactorySpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class EclipseUnmodifiableSetFactorySpec extends UnmodifiableSetFactorySpec {
26 |
27 | def setupSpec() {
28 | factory = new EclipseUnmodifiableSetFactory()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.eclipse/src/test/groovy/pl/tlinkowski/unij/service/collect/eclipse/EclipseUnmodifiableListFactorySpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.eclipse
19 |
20 | import pl.tlinkowski.unij.test.service.collect.UnmodifiableListFactorySpec
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class EclipseUnmodifiableListFactorySpec extends UnmodifiableListFactorySpec {
26 |
27 | def setupSpec() {
28 | factory = new EclipseUnmodifiableListFactory()
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/subprojects/bundles/pl.tlinkowski.unij.bundle.eclipse_jdk8/pl.tlinkowski.unij.bundle.eclipse_jdk8.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.mixedJavaRelease(8)
19 |
20 | dependencies {
21 | implementation(project(":pl.tlinkowski.unij.service.collect.eclipse"))
22 | implementation(project(":pl.tlinkowski.unij.service.misc.jdk8"))
23 |
24 | val eclipseCollectionsHighVersion: String by project // https://www.eclipse.org/collections/
25 | testRuntimeOnly(group = "org.eclipse.collections", name = "eclipse-collections", version = eclipseCollectionsHighVersion)
26 | }
27 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib/src/test/groovy/pl/tlinkowski/unij/sample/lib/SampleLogicSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.lib
19 |
20 | import spock.lang.Specification
21 |
22 | import pl.tlinkowski.unij.api.UniJException
23 |
24 | /**
25 | * @author Tomasz Linkowski
26 | */
27 | class SampleLogicSpec extends Specification {
28 |
29 | def fooBar() {
30 | when:
31 | SampleLogic.fooBar()
32 | then:
33 | UniJException ex = thrown()
34 | ex.message.contains('service implementation not found')
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.eclipse/pl.tlinkowski.unij.service.collect.eclipse.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.mixedJavaRelease(8)
19 |
20 | superpom.useLombok = true
21 |
22 | dependencies {
23 | val eclipseCollectionsLowVersion: String by project // https://www.eclipse.org/collections/
24 |
25 | compileOnly(group = "org.eclipse.collections", name = "eclipse-collections", version = eclipseCollectionsLowVersion)
26 | testRuntimeOnly(group = "org.eclipse.collections", name = "eclipse-collections", version = eclipseCollectionsLowVersion)
27 | }
28 |
--------------------------------------------------------------------------------
/subprojects/bundles/pl.tlinkowski.unij.bundle.jdk8/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * A bundle of bindings for UniJ:
20 | *
24 | *
25 | * @author Tomasz Linkowski
26 | */
27 | @SuppressWarnings("JavaModuleNaming")
28 | module pl.tlinkowski.unij.bundle.jdk8 {
29 | requires transitive pl.tlinkowski.unij.api;
30 |
31 | requires pl.tlinkowski.unij.service.collect.jdk8;
32 | requires pl.tlinkowski.unij.service.misc.jdk8;
33 | }
34 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/pl.tlinkowski.unij.api.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | modularity.mixedJavaRelease(8)
19 |
20 | superpom.useLombok = true
21 |
22 | dependencies {
23 | val slf4jVersion: String by project // https://www.slf4j.org/
24 |
25 | implementation(project(":pl.tlinkowski.unij.service.api"))
26 | implementation(group = "org.slf4j", name = "slf4j-api", version = slf4jVersion)
27 |
28 | testImplementation(project(":pl.tlinkowski.unij.test"))
29 | testRuntimeOnly(project(":pl.tlinkowski.unij.bundle.jdk11"))
30 |
31 | jmhRuntimeOnly(project(":pl.tlinkowski.unij.bundle.jdk11"))
32 | }
33 |
--------------------------------------------------------------------------------
/subprojects/bundles/pl.tlinkowski.unij.bundle.jdk11/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * A bundle of bindings for UniJ:
20 | *
24 | *
25 | * @author Tomasz Linkowski
26 | */
27 | @SuppressWarnings("JavaModuleNaming")
28 | module pl.tlinkowski.unij.bundle.jdk11 {
29 | requires transitive pl.tlinkowski.unij.api;
30 |
31 | requires pl.tlinkowski.unij.service.collect.jdk10;
32 | requires pl.tlinkowski.unij.service.misc.jdk11;
33 | }
34 |
--------------------------------------------------------------------------------
/subprojects/samples/enduser/pl.tlinkowski.unij.sample.enduser.jdk11/src/main/java/pl/tlinkowski/unij/sample/enduser/jdk11/EndUsage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.enduser.jdk11;
19 |
20 | import java.util.List;
21 |
22 | import pl.tlinkowski.unij.api.UniLists;
23 |
24 | /**
25 | * @author Tomasz Linkowski
26 | */
27 | public final class EndUsage {
28 |
29 | public static void main(String[] args) {
30 | System.out.println(names());
31 | }
32 |
33 | public static List names() {
34 | return UniLists.of("foo", "bar");
35 | }
36 |
37 | private EndUsage() {
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/subprojects/samples/enduser/pl.tlinkowski.unij.sample.enduser.jdk8/src/main/java/pl/tlinkowski/unij/sample/enduser/jdk8/EndUsage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.enduser.jdk8;
19 |
20 | import java.util.List;
21 |
22 | import pl.tlinkowski.unij.api.UniLists;
23 |
24 | /**
25 | * @author Tomasz Linkowski
26 | */
27 | public final class EndUsage {
28 |
29 | public static void main(String[] args) {
30 | System.out.println(names());
31 | }
32 |
33 | public static List names() {
34 | return UniLists.of("foo", "bar");
35 | }
36 |
37 | private EndUsage() {
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.jdk8/pl.tlinkowski.unij.sample.lib.usage.jdk8.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | plugins {
19 | application
20 | }
21 |
22 | application {
23 | mainClassName = "${project.name}/${project.name}.SampleLogicMain"
24 | }
25 |
26 | modularity.mixedJavaRelease(8)
27 |
28 | dependencies {
29 | implementation(project(":pl.tlinkowski.unij.sample.lib"))
30 |
31 | implementation(project(":pl.tlinkowski.unij.service.collect.jdk8"))
32 | implementation(project(":pl.tlinkowski.unij.service.misc.jdk8"))
33 | }
34 |
35 | tasks {
36 | check {
37 | dependsOn(run)
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.service.api/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | import pl.tlinkowski.unij.service.api.UniJService;
19 |
20 | /**
21 | * UniJ service interfaces.
22 | *
23 | * Note that all UniJ service implementations must be annotated with {@link UniJService} annotation.
24 | *
25 | * @author Tomasz Linkowski
26 | * @see java.util.ServiceLoader
27 | */
28 | module pl.tlinkowski.unij.service.api {
29 | exports pl.tlinkowski.unij.service.api;
30 | exports pl.tlinkowski.unij.service.api.collect;
31 | exports pl.tlinkowski.unij.service.api.misc;
32 |
33 | requires static pl.tlinkowski.annotation.basic;
34 | }
35 |
--------------------------------------------------------------------------------
/subprojects/bundles/pl.tlinkowski.unij.bundle.guava_jdk8/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * A bundle of bindings for UniJ:
20 | *
25 | *
26 | * @author Tomasz Linkowski
27 | */
28 | @SuppressWarnings("JavaModuleNaming")
29 | module pl.tlinkowski.unij.bundle.guava_jdk8 {
30 | requires transitive pl.tlinkowski.unij.api;
31 |
32 | requires pl.tlinkowski.unij.service.collect.guava;
33 | requires pl.tlinkowski.unij.service.misc.jdk8;
34 | }
35 |
--------------------------------------------------------------------------------
/subprojects/samples/enduser/pl.tlinkowski.unij.sample.enduser.jdk11/pl.tlinkowski.unij.sample.enduser.jdk11.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | plugins {
19 | application
20 | }
21 |
22 | application {
23 | mainClassName = "${project.name}/${project.name}.EndUsage"
24 | }
25 |
26 | modularity.standardJavaRelease(11)
27 |
28 | dependencies {
29 | implementation(project(":pl.tlinkowski.unij.bundle.jdk11"))
30 | }
31 |
32 | tasks {
33 | check {
34 | // `run` fails with "java.lang.module.FindException: Module pl.tlinkowski.unij.sample.enduser.jdk11 not found"
35 | // https://github.com/java9-modularity/gradle-modules-plugin/issues/118
36 | // dependsOn(run)
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/subprojects/bindings/misc/pl.tlinkowski.unij.service.misc.jdk8/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | import pl.tlinkowski.unij.service.api.misc.MiscellaneousApiProvider;
19 | import pl.tlinkowski.unij.service.misc.jdk8.Jdk8MiscellaneousApiProvider;
20 |
21 | /**
22 | * Miscellaneous JDK-8-based bindings for UniJ.
23 | *
24 | * @author Tomasz Linkowski
25 | */
26 | @SuppressWarnings("JavaModuleNaming")
27 | module pl.tlinkowski.unij.service.misc.jdk8 {
28 | requires pl.tlinkowski.unij.service.api;
29 | requires static pl.tlinkowski.annotation.basic;
30 | requires static auto.service.annotations;
31 |
32 | provides MiscellaneousApiProvider with Jdk8MiscellaneousApiProvider;
33 | }
34 |
--------------------------------------------------------------------------------
/subprojects/bundles/pl.tlinkowski.unij.bundle.eclipse_jdk8/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | /**
19 | * A bundle of bindings for UniJ:
20 | *
25 | *
26 | * @author Tomasz Linkowski
27 | */
28 | @SuppressWarnings("JavaModuleNaming")
29 | module pl.tlinkowski.unij.bundle.eclipse_jdk8 {
30 | requires transitive pl.tlinkowski.unij.api;
31 |
32 | requires pl.tlinkowski.unij.service.collect.eclipse;
33 | requires pl.tlinkowski.unij.service.misc.jdk8;
34 | }
35 |
--------------------------------------------------------------------------------
/subprojects/bindings/misc/pl.tlinkowski.unij.service.misc.jdk11/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | import pl.tlinkowski.unij.service.api.misc.MiscellaneousApiProvider;
19 | import pl.tlinkowski.unij.service.misc.jdk11.Jdk11MiscellaneousApiProvider;
20 |
21 | /**
22 | * Miscellaneous JDK-11-based bindings for UniJ.
23 | *
24 | * @author Tomasz Linkowski
25 | */
26 | @SuppressWarnings("JavaModuleNaming")
27 | module pl.tlinkowski.unij.service.misc.jdk11 {
28 | requires pl.tlinkowski.unij.service.api;
29 | requires static pl.tlinkowski.annotation.basic;
30 | requires static auto.service.annotations;
31 |
32 | provides MiscellaneousApiProvider with Jdk11MiscellaneousApiProvider;
33 | }
34 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.service.api/src/main/java/pl/tlinkowski/unij/service/api/UniJService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.api;
19 |
20 | import java.lang.annotation.*;
21 |
22 | /**
23 | * Annotation that should be present on all implementations of UniJ services.
24 | *
25 | * Should always be accompanied by Google's {@code @AutoService} annotation.
26 | *
27 | * @author Tomasz Linkowski
28 | */
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Target(ElementType.TYPE)
31 | public @interface UniJService {
32 |
33 | /**
34 | * Loading priority of this service. Smaller numbers mean higher priority (priority may be negative).
35 | */
36 | int priority();
37 | }
38 |
--------------------------------------------------------------------------------
/subprojects/pl.tlinkowski.unij.test/pl.tlinkowski.unij.test.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | config {
19 | groovydoc {
20 | enabled = true
21 | replaceJavadoc = true
22 | }
23 | }
24 |
25 | superpom.isTestProject = true
26 |
27 | //region REMOVE REDUNDANT KOTLIN-STDLIB DEPENDENCY ADDED BY SUPERPOM PLUGIN
28 | afterEvaluate {
29 | configurations.api {
30 | dependencies.removeIf { it.name == "kotlin-stdlib-jdk8" }
31 | }
32 | }
33 | //endregion
34 |
35 | dependencies {
36 | val slf4jVersion: String by project // https://www.slf4j.org/
37 |
38 | api(project(":pl.tlinkowski.unij.service.api"))
39 | implementation(project(":pl.tlinkowski.unij.api")) // for UniJBundleTest
40 | runtimeOnly(group = "org.slf4j", name = "slf4j-simple", version = slf4jVersion)
41 | }
42 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.guava/pl.tlinkowski.unij.sample.lib.usage.guava.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | plugins {
19 | application
20 | }
21 |
22 | application {
23 | mainClassName = "${project.name}/${project.name}.SampleLogicMain"
24 | }
25 |
26 | modularity.mixedJavaRelease(8)
27 |
28 | dependencies {
29 | implementation(project(":pl.tlinkowski.unij.sample.lib"))
30 |
31 | implementation(project(":pl.tlinkowski.unij.service.collect.guava"))
32 | implementation(project(":pl.tlinkowski.unij.service.misc.jdk8"))
33 |
34 | val guavaHighVersion: String by project // https://github.com/google/guava
35 | runtimeOnly(group = "com.google.guava", name = "guava", version = guavaHighVersion)
36 | }
37 |
38 | tasks {
39 | check {
40 | dependsOn(run)
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.jdk11/pl.tlinkowski.unij.sample.lib.usage.jdk11.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | plugins {
19 | application
20 | }
21 |
22 | application {
23 | mainClassName = "${project.name}/${project.name}.SampleLogicMain"
24 | }
25 |
26 | modularity.standardJavaRelease(11)
27 |
28 | dependencies {
29 | implementation(project(":pl.tlinkowski.unij.sample.lib"))
30 |
31 | implementation(project(":pl.tlinkowski.unij.service.collect.jdk10"))
32 | implementation(project(":pl.tlinkowski.unij.service.misc.jdk11"))
33 | }
34 |
35 | tasks {
36 | check {
37 | // `run` fails with "java.lang.module.FindException: Module pl.tlinkowski.unij.sample.lib.usage.jdk11 not found"
38 | // https://github.com/java9-modularity/gradle-modules-plugin/issues/118
39 | // dependsOn(run)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk10/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | import pl.tlinkowski.unij.service.api.collect.*;
19 | import pl.tlinkowski.unij.service.collect.jdk10.*;
20 |
21 | /**
22 | * Unmodifiable-{@link java.util.Collection}-related JDK-10-based bindings for UniJ.
23 | *
24 | * @author Tomasz Linkowski
25 | */
26 | @SuppressWarnings("JavaModuleNaming")
27 | module pl.tlinkowski.unij.service.collect.jdk10 {
28 | requires pl.tlinkowski.unij.service.api;
29 | requires static pl.tlinkowski.annotation.basic;
30 | requires static auto.service.annotations;
31 |
32 | provides UnmodifiableListFactory with Jdk10UnmodifiableListFactory;
33 | provides UnmodifiableSetFactory with Jdk10UnmodifiableSetFactory;
34 | provides UnmodifiableMapFactory with Jdk10UnmodifiableMapFactory;
35 | }
36 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib.usage.eclipse/pl.tlinkowski.unij.sample.lib.usage.eclipse.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | plugins {
19 | application
20 | }
21 |
22 | application {
23 | mainClassName = "${project.name}/${project.name}.SampleLogicMain"
24 | }
25 |
26 | modularity.mixedJavaRelease(8)
27 |
28 | dependencies {
29 | implementation(project(":pl.tlinkowski.unij.sample.lib"))
30 |
31 | implementation(project(":pl.tlinkowski.unij.service.collect.eclipse"))
32 | implementation(project(":pl.tlinkowski.unij.service.misc.jdk8"))
33 |
34 | val eclipseCollectionsHighVersion: String by project // https://www.eclipse.org/collections/
35 | runtimeOnly(group = "org.eclipse.collections", name = "eclipse-collections", version = eclipseCollectionsHighVersion)
36 | }
37 |
38 | tasks {
39 | check {
40 | dependsOn(run)
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk8/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | import pl.tlinkowski.unij.service.api.collect.*;
19 | import pl.tlinkowski.unij.service.collect.jdk8.*;
20 |
21 | /**
22 | * Unmodifiable-{@link java.util.Collection}-related JDK-8-based bindings for UniJ.
23 | *
24 | * @author Tomasz Linkowski
25 | */
26 | @SuppressWarnings("JavaModuleNaming")
27 | module pl.tlinkowski.unij.service.collect.jdk8 {
28 | requires pl.tlinkowski.unij.service.api;
29 | requires static pl.tlinkowski.annotation.basic;
30 | requires static auto.service.annotations;
31 | requires static lombok;
32 |
33 | provides UnmodifiableListFactory with Jdk8UnmodifiableListFactory;
34 | provides UnmodifiableSetFactory with Jdk8UnmodifiableSetFactory;
35 | provides UnmodifiableMapFactory with Jdk8UnmodifiableMapFactory;
36 | }
37 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.guava/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | import pl.tlinkowski.unij.service.api.collect.*;
19 | import pl.tlinkowski.unij.service.collect.guava.*;
20 |
21 | /**
22 | * Unmodifiable-{@link java.util.Collection}-related Guava-based bindings
23 | * for UniJ.
24 | *
25 | * @author Tomasz Linkowski
26 | */
27 | module pl.tlinkowski.unij.service.collect.guava {
28 | requires com.google.common;
29 |
30 | requires pl.tlinkowski.unij.service.api;
31 | requires static pl.tlinkowski.annotation.basic;
32 | requires static auto.service.annotations;
33 | requires static lombok;
34 |
35 | provides UnmodifiableListFactory with GuavaUnmodifiableListFactory;
36 | provides UnmodifiableSetFactory with GuavaUnmodifiableSetFactory;
37 | provides UnmodifiableMapFactory with GuavaUnmodifiableMapFactory;
38 | }
39 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.eclipse/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | import pl.tlinkowski.unij.service.api.collect.*;
19 | import pl.tlinkowski.unij.service.collect.eclipse.*;
20 |
21 | /**
22 | * Unmodifiable-{@link java.util.Collection}-related Eclipse-based
23 | * bindings for UniJ.
24 | *
25 | * @author Tomasz Linkowski
26 | */
27 | module pl.tlinkowski.unij.service.collect.eclipse {
28 | requires org.eclipse.collections.api;
29 | requires org.eclipse.collections.impl;
30 |
31 | requires pl.tlinkowski.unij.service.api;
32 | requires static pl.tlinkowski.annotation.basic;
33 | requires static auto.service.annotations;
34 | requires static lombok;
35 |
36 | provides UnmodifiableListFactory with EclipseUnmodifiableListFactory;
37 | provides UnmodifiableSetFactory with EclipseUnmodifiableSetFactory;
38 | provides UnmodifiableMapFactory with EclipseUnmodifiableMapFactory;
39 | }
40 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/main/java/pl/tlinkowski/unij/api/UniJ.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.api;
19 |
20 | import lombok.Getter;
21 | import lombok.experimental.UtilityClass;
22 |
23 | import pl.tlinkowski.unij.service.api.collect.*;
24 | import pl.tlinkowski.unij.service.api.misc.MiscellaneousApiProvider;
25 |
26 | /**
27 | * @author Tomasz Linkowski
28 | */
29 | @UtilityClass
30 | final class UniJ {
31 |
32 | @Getter(lazy = true)
33 | private static final UnmodifiableListFactory listFactory = UniJLoader.load(UnmodifiableListFactory.class);
34 | @Getter(lazy = true)
35 | private static final UnmodifiableSetFactory setFactory = UniJLoader.load(UnmodifiableSetFactory.class);
36 | @Getter(lazy = true)
37 | private static final UnmodifiableMapFactory mapFactory = UniJLoader.load(UnmodifiableMapFactory.class);
38 |
39 | @Getter(lazy = true)
40 | private static final MiscellaneousApiProvider miscProvider = UniJLoader.load(MiscellaneousApiProvider.class);
41 | }
42 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | import pl.tlinkowski.unij.api.*;
19 | import pl.tlinkowski.unij.service.api.collect.*;
20 | import pl.tlinkowski.unij.service.api.misc.MiscellaneousApiProvider;
21 |
22 | /**
23 | * UniJ API for the end users.
24 | *
25 | * The API consists of the following static utility classes: {@link UniLists}, {@link UniSets}, {@link UniMaps}, {@link
26 | * UniCollectors}.
27 | *
28 | * @author Tomasz Linkowski
29 | * @uses UnmodifiableListFactory
30 | * @uses UnmodifiableSetFactory
31 | * @uses UnmodifiableMapFactory
32 | * @uses MiscellaneousApiProvider
33 | */
34 | module pl.tlinkowski.unij.api {
35 | exports pl.tlinkowski.unij.api;
36 |
37 | requires pl.tlinkowski.unij.service.api;
38 | requires org.slf4j;
39 |
40 | requires static pl.tlinkowski.annotation.basic;
41 | requires static lombok;
42 |
43 | uses UnmodifiableListFactory;
44 | uses UnmodifiableSetFactory;
45 | uses UnmodifiableMapFactory;
46 | uses MiscellaneousApiProvider;
47 | }
48 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.service.api/src/main/java/pl/tlinkowski/unij/service/api/misc/MiscellaneousApiProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.api.misc;
19 |
20 | import java.util.function.Function;
21 | import java.util.function.Predicate;
22 | import java.util.stream.*;
23 |
24 | /**
25 | * Provider of miscellaneous JDK APIs added since JDK 9. Provides:
26 | *
27 | *
a few {@link Collector}s from {@link Collectors} utility class
28 | *
29 | *
30 | * @author Tomasz Linkowski
31 | */
32 | public interface MiscellaneousApiProvider {
33 |
34 | //region COLLECTORS
35 |
36 | /**
37 | * Equivalent of {@link Collectors#flatMapping(Function, Collector)}.
38 | */
39 | Collector flatMappingCollector(Function super T, ? extends Stream extends U>> mapper,
40 | Collector super U, A, R> downstream);
41 |
42 | /**
43 | * Equivalent of {@link Collectors#filtering(Predicate, Collector)}.
44 | */
45 | Collector filteringCollector(Predicate super T> predicate,
46 | Collector super T, A, R> downstream);
47 | //endregion
48 | }
49 |
--------------------------------------------------------------------------------
/subprojects/pl.tlinkowski.unij.test/src/main/groovy/pl/tlinkowski/unij/test/bundle/UniJBundleTest.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.test.bundle
19 |
20 | import spock.lang.Specification
21 |
22 | import java.util.stream.Collectors
23 |
24 | import pl.tlinkowski.unij.api.*
25 |
26 | /**
27 | * Test that should be extended by every bundle.
28 | *
29 | * This test verifies that a bundle has proper runtime dependencies.
30 | *
31 | * @author Tomasz Linkowski
32 | */
33 | abstract class UniJBundleTest extends Specification {
34 |
35 | def "UnmodifiableListFactory implementation found"() {
36 | when:
37 | UniLists.of()
38 | then:
39 | noExceptionThrown()
40 | }
41 |
42 | def "UnmodifiableSetFactory implementation found"() {
43 | when:
44 | UniSets.of()
45 | then:
46 | noExceptionThrown()
47 | }
48 |
49 | def "UnmodifiableMapFactory implementation found"() {
50 | when:
51 | UniMaps.of()
52 | then:
53 | noExceptionThrown()
54 | }
55 |
56 | def "MiscellaneousApiProvider implementation found"() {
57 | when:
58 | UniCollectors.filtering({ true }, Collectors.toList())
59 | then:
60 | noExceptionThrown()
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/subprojects/bindings/misc/pl.tlinkowski.unij.service.misc.jdk11/src/main/java/pl/tlinkowski/unij/service/misc/jdk11/Jdk11MiscellaneousApiProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.misc.jdk11;
19 |
20 | import java.util.function.Function;
21 | import java.util.function.Predicate;
22 | import java.util.stream.*;
23 |
24 | import com.google.auto.service.AutoService;
25 |
26 | import pl.tlinkowski.unij.service.api.UniJService;
27 | import pl.tlinkowski.unij.service.api.misc.MiscellaneousApiProvider;
28 |
29 | /**
30 | * Implementation of {@link MiscellaneousApiProvider} that delegates to original JDK 11 APIs.
31 | *
32 | * @author Tomasz Linkowski
33 | */
34 | @UniJService(priority = 10)
35 | @AutoService(MiscellaneousApiProvider.class)
36 | public final class Jdk11MiscellaneousApiProvider implements MiscellaneousApiProvider {
37 |
38 | //region COLLECTORS
39 | @Override
40 | public Collector flatMappingCollector(Function super T, ? extends Stream extends U>> mapper,
41 | Collector super U, A, R> downstream) {
42 | return Collectors.flatMapping(mapper, downstream);
43 | }
44 |
45 | @Override
46 | public Collector filteringCollector(Predicate super T> predicate,
47 | Collector super T, A, R> downstream) {
48 | return Collectors.filtering(predicate, downstream);
49 | }
50 | //endregion
51 | }
52 |
--------------------------------------------------------------------------------
/subprojects/samples/lib/pl.tlinkowski.unij.sample.lib/src/main/java/pl/tlinkowski/unij/sample/lib/SampleLogic.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.sample.lib;
19 |
20 | import java.util.*;
21 |
22 | import pl.tlinkowski.unij.api.*;
23 |
24 | /**
25 | * @author Tomasz Linkowski
26 | */
27 | public final class SampleLogic {
28 |
29 | private final Map map = UniMaps.of(
30 | "a", "b",
31 | "c", "de"
32 | );
33 |
34 | public static int fooBar() {
35 | return new SampleLogic().foo("bar");
36 | }
37 |
38 | /**
39 | * Computes {@code foo} from given {@code bar}.
40 | */
41 | public int foo(String bar) {
42 | String baz = replaceAll(bar);
43 | List list = letters(baz);
44 | Set set = UniSets.copyOf(list);
45 | return sum(set);
46 | }
47 |
48 | private String replaceAll(String string) {
49 | return map.entrySet().stream().reduce(
50 | string, (str, entry) -> str.replace(entry.getKey(), entry.getValue()), SampleLogic::combineUnsupported
51 | );
52 | }
53 |
54 | private static List letters(String string) {
55 | return string.codePoints().boxed().collect(UniCollectors.filtering(
56 | Character::isLetter, UniCollectors.toUnmodifiableList()
57 | ));
58 | }
59 |
60 | private static int sum(Collection ints) {
61 | return ints.stream().mapToInt(Integer::intValue).sum();
62 | }
63 |
64 | private static T combineUnsupported(T t1, T t2) {
65 | throw new UnsupportedOperationException();
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/subprojects/pl.tlinkowski.unij.test/src/main/groovy/pl/tlinkowski/unij/test/service/collect/UnmodifiableCollectionSpecHelper.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.test.service.collect
19 |
20 | import groovy.transform.PackageScope
21 |
22 | import java.util.stream.Collector
23 |
24 | /**
25 | * Helper class for the {@link List}/{@link Set} specs.
26 | *
27 | * Includes data pipes: http://spockframework.org/spock/docs/1.3/data_driven_testing.html#_data_pipes
28 | *
29 | * @author Tomasz Linkowski
30 | */
31 | @PackageScope
32 | class UnmodifiableCollectionSpecHelper {
33 |
34 | //region DATA PIPES
35 | static List> lists() {
36 | [
37 | [],
38 | [1],
39 | [1, 2],
40 | [1, 2, 3],
41 | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
42 | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
43 | ]
44 | }
45 |
46 | static List> listsWithNull() {
47 | [
48 | [null],
49 | [1, null],
50 | [1, 2, null],
51 | [1, 2, 3, 4, 5, 6, 7, 8, 9, null],
52 | [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, null]
53 | ]
54 | }
55 | //endregion
56 |
57 | //region ARGS
58 | static List args(int size) {
59 | size == 0 ? [] : 1..size
60 | }
61 |
62 | static List argsWithNull(int size, int nullIndex) {
63 | Integer[] args = args(size)
64 | args[nullIndex] = null
65 | args
66 | }
67 | //endregion
68 |
69 | //region COLLECT
70 | static > C collect(Collector collector, List list) {
71 | list.stream().collect(collector)
72 | }
73 | //endregion
74 | }
75 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/jmh/java/pl/tlinkowski/unij/api/UniListsBenchmark.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.api;
19 |
20 | import java.util.List;
21 | import java.util.concurrent.TimeUnit;
22 |
23 | import org.openjdk.jmh.annotations.*;
24 |
25 | /**
26 | * @author Tomasz Linkowski
27 | */
28 | @BenchmarkMode(Mode.AverageTime)
29 | @OutputTimeUnit(TimeUnit.NANOSECONDS)
30 | public class UniListsBenchmark {
31 |
32 | //region of()
33 | @Benchmark
34 | public List> listOf() {
35 | return List.of();
36 | }
37 |
38 | @Benchmark
39 | public List> uniListsOf() {
40 | return UniLists.of();
41 | }
42 | //endregion
43 |
44 | //region of(n=1)
45 | @Benchmark
46 | public List> listOf1() {
47 | return List.of(1);
48 | }
49 |
50 | @Benchmark
51 | public List> uniListsOf1() {
52 | return UniLists.of(1);
53 | }
54 | //endregion
55 |
56 | //region of(n=2)
57 | @Benchmark
58 | public List> listOf2() {
59 | return List.of(1, 2);
60 | }
61 |
62 | @Benchmark
63 | public List> uniListsOf2() {
64 | return UniLists.of(1, 2);
65 | }
66 | //endregion
67 |
68 | //region of(n=3)
69 | @Benchmark
70 | public List> listOf3() {
71 | return List.of(1, 2, 3);
72 | }
73 |
74 | @Benchmark
75 | public List> uniListsOf3() {
76 | return UniLists.of(1, 2, 3);
77 | }
78 | //endregion
79 |
80 | //region of(n=10)
81 | @Benchmark
82 | public List> listOf10() {
83 | return List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
84 | }
85 |
86 | @Benchmark
87 | public List> uniListsOf10() {
88 | return UniLists.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
89 | }
90 | //endregion
91 |
92 | //region of(n=20)
93 | @Benchmark
94 | public List> listOf20() {
95 | return List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
96 | }
97 |
98 | @Benchmark
99 | public List> uniListsOf20() {
100 | return UniLists.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
101 | }
102 | //endregion
103 | }
104 |
--------------------------------------------------------------------------------
/subprojects/pl.tlinkowski.unij.test/src/main/groovy/pl/tlinkowski/unij/test/service/misc/MiscellaneousApiProviderSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.test.service.misc
19 |
20 | import spock.lang.Shared
21 | import spock.lang.Specification
22 |
23 | import java.util.stream.Collectors
24 | import java.util.stream.Stream
25 |
26 | import pl.tlinkowski.unij.service.api.misc.MiscellaneousApiProvider
27 |
28 | /**
29 | * Specification for {@link MiscellaneousApiProvider}.
30 | *
31 | * Inheriting classes should initialize {@code provider} in the {@code setupSpec} method.
32 | *
33 | * @author Tomasz Linkowski
34 | */
35 | abstract class MiscellaneousApiProviderSpec extends Specification {
36 |
37 | @Shared
38 | protected MiscellaneousApiProvider provider
39 |
40 | //region COLLECTORS: STANDARD CONTRACT (corresponds to MISCELLANEOUS region of UniCollectorsSpec)
41 | def "flatMappingCollector"(List list, List expected) {
42 | when:
43 | def collector = provider.flatMappingCollector({ Stream.of(it, -it) }, Collectors.toList())
44 | then:
45 | list.stream().collect(collector) == expected
46 | where:
47 | list | expected
48 | [] | []
49 | [1] | [1, -1]
50 | [-1] | [-1, 1]
51 | [1, 2] | [1, -1, 2, -2]
52 | [1, 2, 3] | [1, -1, 2, -2, 3, -3]
53 | }
54 |
55 | def "filteringCollector"(List list, List expected) {
56 | when:
57 | def collector = provider.filteringCollector({ it % 2 != 0 }, Collectors.toList())
58 | then:
59 | list.stream().collect(collector) == expected
60 | where:
61 | list | expected
62 | [] | []
63 | [1] | [1]
64 | [2] | []
65 | [1, 2] | [1]
66 | [1, 2, 3] | [1, 3]
67 | }
68 | //endregion
69 |
70 | //region COLLECTORS: SPECIAL CASES
71 | def "flatMappingCollector handles null as empty stream"() {
72 | when:
73 | def collector = provider.flatMappingCollector({ null }, Collectors.toList())
74 | then:
75 | [1, 2, 3].stream().collect(collector) == []
76 | }
77 | //endregion
78 | }
79 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/test/groovy/pl/tlinkowski/unij/api/UniSetsSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.api
19 |
20 | import spock.lang.Specification
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class UniSetsSpec extends Specification {
26 |
27 | def "copyOf"(Set list) {
28 | expect:
29 | UniSets.copyOf(list) == Set.copyOf(list)
30 | where:
31 | list | _
32 | [] | _
33 | [1] | _
34 | [1, 2] | _
35 | [1, 2, 3] | _
36 | }
37 |
38 | def "of(n=0)"() {
39 | expect:
40 | UniSets.of() == Set.of()
41 | }
42 |
43 | def "of(n=1)"() {
44 | expect:
45 | UniSets.of(1) == Set.of(1)
46 | }
47 |
48 | def "of(n=2)"() {
49 | expect:
50 | UniSets.of(1, 2) == Set.of(1, 2)
51 | }
52 |
53 | def "of(n=3)"() {
54 | expect:
55 | UniSets.of(1, 2, 3) == Set.of(1, 2, 3)
56 | }
57 |
58 | def "of(n=4)"() {
59 | expect:
60 | UniSets.of(1, 2, 3, 4) == Set.of(1, 2, 3, 4)
61 | }
62 |
63 | def "of(n=5)"() {
64 | expect:
65 | UniSets.of(1, 2, 3, 4, 5) == Set.of(1, 2, 3, 4, 5)
66 | }
67 |
68 | def "of(n=6)"() {
69 | expect:
70 | UniSets.of(1, 2, 3, 4, 5, 6) ==
71 | Set.of(1, 2, 3, 4, 5, 6)
72 | }
73 |
74 | def "of(n=7)"() {
75 | expect:
76 | UniSets.of(1, 2, 3, 4, 5, 6, 7) ==
77 | Set.of(1, 2, 3, 4, 5, 6, 7)
78 | }
79 |
80 | def "of(n=8)"() {
81 | expect:
82 | UniSets.of(1, 2, 3, 4, 5, 6, 7, 8) ==
83 | Set.of(1, 2, 3, 4, 5, 6, 7, 8)
84 | }
85 |
86 | def "of(n=9)"() {
87 | expect:
88 | UniSets.of(1, 2, 3, 4, 5, 6, 7, 8, 9) ==
89 | Set.of(1, 2, 3, 4, 5, 6, 7, 8, 9)
90 | }
91 |
92 | def "of(n=10)"() {
93 | expect:
94 | UniSets.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) ==
95 | Set.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
96 | }
97 |
98 | def "of(...)"() {
99 | expect:
100 | UniSets.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) ==
101 | Set.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/test/groovy/pl/tlinkowski/unij/api/UniListsSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.api
19 |
20 | import spock.lang.Specification
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class UniListsSpec extends Specification {
26 |
27 | def "copyOf"(List list) {
28 | expect:
29 | UniLists.copyOf(list) == List.copyOf(list)
30 | where:
31 | list | _
32 | [] | _
33 | [1] | _
34 | [1, 2] | _
35 | [1, 2, 3] | _
36 | }
37 |
38 | def "of(n=0)"() {
39 | expect:
40 | UniLists.of() == List.of()
41 | }
42 |
43 | def "of(n=1)"() {
44 | expect:
45 | UniLists.of(1) == List.of(1)
46 | }
47 |
48 | def "of(n=2)"() {
49 | expect:
50 | UniLists.of(1, 2) == List.of(1, 2)
51 | }
52 |
53 | def "of(n=3)"() {
54 | expect:
55 | UniLists.of(1, 2, 3) == List.of(1, 2, 3)
56 | }
57 |
58 | def "of(n=4)"() {
59 | expect:
60 | UniLists.of(1, 2, 3, 4) == List.of(1, 2, 3, 4)
61 | }
62 |
63 | def "of(n=5)"() {
64 | expect:
65 | UniLists.of(1, 2, 3, 4, 5) == List.of(1, 2, 3, 4, 5)
66 | }
67 |
68 | def "of(n=6)"() {
69 | expect:
70 | UniLists.of(1, 2, 3, 4, 5, 6) ==
71 | List.of(1, 2, 3, 4, 5, 6)
72 | }
73 |
74 | def "of(n=7)"() {
75 | expect:
76 | UniLists.of(1, 2, 3, 4, 5, 6, 7) ==
77 | List.of(1, 2, 3, 4, 5, 6, 7)
78 | }
79 |
80 | def "of(n=8)"() {
81 | expect:
82 | UniLists.of(1, 2, 3, 4, 5, 6, 7, 8) ==
83 | List.of(1, 2, 3, 4, 5, 6, 7, 8)
84 | }
85 |
86 | def "of(n=9)"() {
87 | expect:
88 | UniLists.of(1, 2, 3, 4, 5, 6, 7, 8, 9) ==
89 | List.of(1, 2, 3, 4, 5, 6, 7, 8, 9)
90 | }
91 |
92 | def "of(n=10)"() {
93 | expect:
94 | UniLists.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) ==
95 | List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
96 | }
97 |
98 | def "of(...)"() {
99 | expect:
100 | UniLists.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) ==
101 | List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/lombok.config:
--------------------------------------------------------------------------------
1 | #
2 | # https://projectlombok.org/features/configuration
3 | #
4 |
5 | ## Tell the configuration system it should stop looking for other configuration files (default: false).
6 | config.stopBubbling = true
7 |
8 | ## Generate getters and setters using only the field name (no get/set prefix) (default: false).
9 | lombok.accessors.fluent = true
10 |
11 | ## Copy these annotations to getters, setters, withers, builder-setters, etc.
12 | ## (source: https://github.com/tlinkowski/basic-annotations)
13 | lombok.copyableAnnotations += kotlin.annotations.jvm.ReadOnly
14 | lombok.copyableAnnotations += kotlin.annotations.jvm.Mutable
15 | lombok.copyableAnnotations += pl.tlinkowski.annotation.basic.NullOr
16 |
17 | ## Generate @lombok.Generated on all generated code (default: false).
18 | lombok.addLombokGeneratedAnnotation = true
19 |
20 | ## Generate a private no-args constructor for @Data and @Value (default: true).
21 | # lombok.noArgsConstructor.extraPrivate = [false | true]
22 |
23 | ## When generating equals and hashCode for classes that extend something (other than Object), either automatically take
24 | ## into account superclass implementation (call), or don't (skip), or warn and don't (warn). (default = warn).
25 | # lombok.equalsAndHashCode.callSuper = [CALL | SKIP | WARN]
26 |
27 | ## When generating toString for classes that extend something (other than Object), either automatically take
28 | ## into account superclass implementation (call), or don't (skip), or warn and don't (warn). (default = warn).
29 | # lombok.toString.callSuper = [CALL | SKIP | WARN]
30 |
31 | ## Include the field names in the generated toString method (default = true).
32 | # lombok.toString.includeFieldNames = [false | true]
33 |
34 | #
35 | # FLAG USAGE
36 | #
37 |
38 | ## Emit a warning or error if @Cleanup is used.
39 | lombok.cleanup.flagUsage = ERROR
40 |
41 | ## Emit a warning or error if @Delegate is used.
42 | lombok.delegate.flagUsage = ERROR
43 |
44 | ## Emit a warning or error if @ExtensionMethod is used.
45 | lombok.extensionMethod.flagUsage = ERROR
46 |
47 | ## Emit a warning or error if @FieldDefaults is used.
48 | lombok.fieldDefaults.flagUsage = ERROR
49 |
50 | ## Emit a warning or error if @Helper is used.
51 | lombok.helper.flagUsage = ERROR
52 |
53 | ## Emit a warning or error if @CommonsLog is used.
54 | lombok.log.apacheCommons.flagUsage = ERROR
55 |
56 | ## Emit a warning or error if @Flogger is used.
57 | lombok.log.flogger.flagUsage = ERROR
58 |
59 | ## Emit a warning or error if @Log is used.
60 | lombok.log.javaUtilLogging.flagUsage = ERROR
61 |
62 | ## Emit a warning or error if @JBossLog is used.
63 | lombok.log.jbosslog.flagUsage = ERROR
64 |
65 | ## Emit a warning or error if @Log4j is used.
66 | lombok.log.log4j.flagUsage = ERROR
67 |
68 | ## Emit a warning or error if @Log4j2 is used.
69 | lombok.log.log4j2.flagUsage = ERROR
70 |
71 | ## Emit a warning or error if @Synchronized is used.
72 | lombok.synchronized.flagUsage = ERROR
73 |
74 | ## Emit a warning or error if 'var' is used.
75 | lombok.var.flagUsage = ERROR
76 |
--------------------------------------------------------------------------------
/subprojects/bindings/misc/pl.tlinkowski.unij.service.misc.jdk8/src/main/java/pl/tlinkowski/unij/service/misc/jdk8/Jdk8MiscellaneousApiProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.misc.jdk8;
19 |
20 | import java.util.function.*;
21 | import java.util.stream.*;
22 |
23 | import com.google.auto.service.AutoService;
24 |
25 | import pl.tlinkowski.unij.service.api.UniJService;
26 | import pl.tlinkowski.unij.service.api.misc.MiscellaneousApiProvider;
27 |
28 | /**
29 | * Implementation of {@link MiscellaneousApiProvider} that delegates to original JDK 11 APIs.
30 | *
31 | * @author Tomasz Linkowski
32 | */
33 | @UniJService(priority = 40)
34 | @AutoService(MiscellaneousApiProvider.class)
35 | public final class Jdk8MiscellaneousApiProvider implements MiscellaneousApiProvider {
36 |
37 | //region COLLECTORS
38 |
39 | /**
40 | * Based on {@link Collectors#flatMapping(Function, Collector)}.
41 | */
42 | @Override
43 | public Collector flatMappingCollector(Function super T, ? extends Stream extends U>> mapper,
44 | Collector super U, A, R> downstream) {
45 | BiConsumer accumulator = downstream.accumulator();
46 | BiConsumer newAccumulator = (a, t) -> {
47 | try (Stream extends U> mappedStream = mapper.apply(t)) {
48 | if (mappedStream != null) {
49 | mappedStream.sequential().forEach(u -> accumulator.accept(a, u));
50 | }
51 | }
52 | };
53 | return collectorWithNewAccumulator(downstream, newAccumulator);
54 | }
55 |
56 | /**
57 | * Based on {@link Collectors#filtering(Predicate, Collector)}.
58 | */
59 | @Override
60 | public Collector filteringCollector(Predicate super T> predicate,
61 | Collector super T, A, R> downstream) {
62 | BiConsumer accumulator = downstream.accumulator();
63 | BiConsumer newAccumulator = (a, t) -> {
64 | if (predicate.test(t)) {
65 | accumulator.accept(a, t);
66 | }
67 | };
68 | return collectorWithNewAccumulator(downstream, newAccumulator);
69 | }
70 |
71 | private Collector collectorWithNewAccumulator(Collector, A, R> collector,
72 | BiConsumer newAccumulator) {
73 | return Collector.of(
74 | collector.supplier(), newAccumulator, collector.combiner(), collector.finisher(),
75 | collector.characteristics().toArray(new Collector.Characteristics[0])
76 | );
77 | }
78 | //endregion
79 | }
80 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 |
35 | @rem Find java.exe
36 | if defined JAVA_HOME goto findJavaFromJavaHome
37 |
38 | set JAVA_EXE=java.exe
39 | %JAVA_EXE% -version >NUL 2>&1
40 | if "%ERRORLEVEL%" == "0" goto init
41 |
42 | echo.
43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44 | echo.
45 | echo Please set the JAVA_HOME variable in your environment to match the
46 | echo location of your Java installation.
47 |
48 | goto fail
49 |
50 | :findJavaFromJavaHome
51 | set JAVA_HOME=%JAVA_HOME:"=%
52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53 |
54 | if exist "%JAVA_EXE%" goto init
55 |
56 | echo.
57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58 | echo.
59 | echo Please set the JAVA_HOME variable in your environment to match the
60 | echo location of your Java installation.
61 |
62 | goto fail
63 |
64 | :init
65 | @rem Get command-line arguments, handling Windows variants
66 |
67 | if not "%OS%" == "Windows_NT" goto win9xME_args
68 |
69 | :win9xME_args
70 | @rem Slurp the command line arguments.
71 | set CMD_LINE_ARGS=
72 | set _SKIP=2
73 |
74 | :win9xME_args_slurp
75 | if "x%~1" == "x" goto execute
76 |
77 | set CMD_LINE_ARGS=%*
78 |
79 | :execute
80 | @rem Setup the command line
81 |
82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83 |
84 | @rem Execute Gradle
85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86 |
87 | :end
88 | @rem End local scope for the variables with windows NT shell
89 | if "%ERRORLEVEL%"=="0" goto mainEnd
90 |
91 | :fail
92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93 | rem the _cmd.exe /c_ return code!
94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95 | exit /b 1
96 |
97 | :mainEnd
98 | if "%OS%"=="Windows_NT" endlocal
99 |
100 | :omega
101 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/main/java/pl/tlinkowski/unij/api/UniCollectors.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.api;
19 |
20 | import java.util.*;
21 | import java.util.function.*;
22 | import java.util.stream.*;
23 |
24 | import lombok.experimental.UtilityClass;
25 |
26 | /**
27 | * Provides some {@link Collector} factory methods present in {@link java.util.stream.Collectors} class.
28 | *
29 | * @author Tomasz Linkowski
30 | */
31 | @UtilityClass
32 | public final class UniCollectors {
33 |
34 | //region COLLECTIONS
35 |
36 | /**
37 | * Equivalent of {@link java.util.stream.Collectors#toUnmodifiableList()}.
38 | */
39 | public static Collector> toUnmodifiableList() {
40 | return UniJ.listFactory().collector();
41 | }
42 |
43 | /**
44 | * Equivalent of {@link java.util.stream.Collectors#toUnmodifiableSet()}.
45 | */
46 | public static Collector> toUnmodifiableSet() {
47 | return UniJ.setFactory().collector();
48 | }
49 |
50 | /**
51 | * Equivalent of {@link java.util.stream.Collectors#toUnmodifiableMap(Function, Function)}.
52 | */
53 | public static Collector> toUnmodifiableMap(
54 | Function super T, ? extends K> keyMapper, Function super T, ? extends V> valueMapper) {
55 | return UniJ.mapFactory().collector(keyMapper, valueMapper);
56 | }
57 |
58 | /**
59 | * Equivalent of {@link java.util.stream.Collectors#toUnmodifiableMap(Function, Function, BinaryOperator)}.
60 | */
61 | public static Collector> toUnmodifiableMap(
62 | Function super T, ? extends K> keyMapper, Function super T, ? extends V> valueMapper,
63 | BinaryOperator mergeFunction) {
64 | return UniJ.mapFactory().collector(keyMapper, valueMapper, mergeFunction);
65 | }
66 | //endregion
67 |
68 | //region MISCELLANEOUS
69 |
70 | /**
71 | * Equivalent of {@link Collectors#flatMapping(Function, Collector)}.
72 | */
73 | public static Collector flatMapping(
74 | Function super T, ? extends Stream extends U>> mapper, Collector super U, A, R> downstream) {
75 | return UniJ.miscProvider().flatMappingCollector(mapper, downstream);
76 | }
77 |
78 | /**
79 | * Equivalent of {@link Collectors#filtering(Predicate, Collector)}.
80 | */
81 | public static Collector filtering(Predicate super T> predicate,
82 | Collector super T, A, R> downstream) {
83 | return UniJ.miscProvider().filteringCollector(predicate, downstream);
84 | }
85 | //endregion
86 | }
87 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/test/groovy/pl/tlinkowski/unij/api/UniJLoaderSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.api
19 |
20 | import spock.lang.Specification
21 |
22 | import pl.tlinkowski.unij.service.api.UniJService
23 |
24 | /**
25 | * @author Tomasz Linkowski
26 | */
27 | class UniJLoaderSpec extends Specification {
28 |
29 | //region SERVICE WITHOUT IMPLEMENTATION
30 | def "load() throws when service implementation is missing"() {
31 | when:
32 | UniJLoader.load(NoImplService)
33 | then:
34 | UniJException ex = thrown()
35 | ex.message.contains(NoImplService.name)
36 | ex.message.contains("service implementation not found")
37 | }
38 |
39 | interface NoImplService {
40 | }
41 | //endregion
42 |
43 | //region MISSING @UniJService ANNOTATION
44 | def "load() throws when @UniJService annotation is missing"() {
45 | when:
46 | UniJLoader.load(UnannotatedService)
47 | then:
48 | UniJException ex = thrown()
49 | ex.message.contains(UnannotatedServiceImpl.name)
50 | ex.message.contains("not annotated with")
51 | }
52 |
53 | interface UnannotatedService {
54 | }
55 |
56 | static class UnannotatedServiceImpl implements UnannotatedService {
57 | }
58 | //endregion
59 |
60 | //region DUPLICATE PRIORITY
61 | def "load() throws when two service implementations have the same priority"() {
62 | when:
63 | UniJLoader.load(DuplicatePriorityService)
64 | then:
65 | UniJException ex = thrown()
66 | ex.message.contains(DuplicatePriorityServiceImpl1.name)
67 | ex.message.contains(DuplicatePriorityServiceImpl2.name)
68 | ex.message.contains("same priority")
69 | }
70 |
71 | interface DuplicatePriorityService {
72 | }
73 |
74 | @UniJService(priority = 10)
75 | static class DuplicatePriorityServiceImpl1 implements DuplicatePriorityService {
76 | }
77 |
78 | @UniJService(priority = 10)
79 | static class DuplicatePriorityServiceImpl2 implements DuplicatePriorityService {
80 | }
81 | //endregion
82 |
83 | //region DIFFERENT PRIORITY
84 | def "load() selects implementation with a higher priority"() {
85 | when:
86 | def service = UniJLoader.load(DifferentPriorityService)
87 | then:
88 | service instanceof DifferentPriorityServiceImpl2
89 | }
90 |
91 | interface DifferentPriorityService {
92 | }
93 |
94 | @UniJService(priority = 10)
95 | static class DifferentPriorityServiceImpl1 implements DifferentPriorityService {
96 | }
97 |
98 | @UniJService(priority = -10)
99 | static class DifferentPriorityServiceImpl2 implements DifferentPriorityService {
100 | }
101 | //endregion
102 | }
103 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk10/src/main/java/pl/tlinkowski/unij/service/collect/jdk10/Jdk10UnmodifiableSetFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.jdk10;
19 |
20 | import java.util.Collection;
21 | import java.util.Set;
22 | import java.util.stream.Collector;
23 | import java.util.stream.Collectors;
24 |
25 | import com.google.auto.service.AutoService;
26 |
27 | import pl.tlinkowski.unij.service.api.UniJService;
28 | import pl.tlinkowski.unij.service.api.collect.UnmodifiableSetFactory;
29 |
30 | /**
31 | * Implementation of {@link UnmodifiableSetFactory} that returns unmodifiable
32 | * sets introduced in JDK 10.
33 | *
34 | * @author Tomasz Linkowski
35 | */
36 | @UniJService(priority = 10)
37 | @AutoService(UnmodifiableSetFactory.class)
38 | public final class Jdk10UnmodifiableSetFactory implements UnmodifiableSetFactory {
39 |
40 | //region COLLECTOR
41 | @Override
42 | public Collector> collector() {
43 | return Collectors.toUnmodifiableSet();
44 | }
45 | //endregion
46 |
47 | //region COPY OF
48 | @Override
49 | public Set copyOf(Collection extends E> coll) {
50 | return Set.copyOf(coll);
51 | }
52 | //endregion
53 |
54 | //region OF
55 | @Override
56 | public Set of() {
57 | return Set.of();
58 | }
59 |
60 | @Override
61 | public Set of(E e1) {
62 | return Set.of(e1);
63 | }
64 |
65 | @Override
66 | public Set of(E e1, E e2) {
67 | return Set.of(e1, e2);
68 | }
69 |
70 | @Override
71 | public Set of(E e1, E e2, E e3) {
72 | return Set.of(e1, e2, e3);
73 | }
74 |
75 | @Override
76 | public Set of(E e1, E e2, E e3, E e4) {
77 | return Set.of(e1, e2, e3, e4);
78 | }
79 |
80 | @Override
81 | public Set of(E e1, E e2, E e3, E e4, E e5) {
82 | return Set.of(e1, e2, e3, e4, e5);
83 | }
84 |
85 | @Override
86 | public Set of(E e1, E e2, E e3, E e4, E e5, E e6) {
87 | return Set.of(e1, e2, e3, e4, e5, e6);
88 | }
89 |
90 | @Override
91 | public Set of(E e1, E e2, E e3, E e4, E e5, E e6, E e7) {
92 | return Set.of(e1, e2, e3, e4, e5, e6, e7);
93 | }
94 |
95 | @Override
96 | public Set of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8) {
97 | return Set.of(e1, e2, e3, e4, e5, e6, e7, e8);
98 | }
99 |
100 | @Override
101 | public Set of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9) {
102 | return Set.of(e1, e2, e3, e4, e5, e6, e7, e8, e9);
103 | }
104 |
105 | @SuppressWarnings("PMD.ExcessiveParameterList")
106 | @Override
107 | public Set of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10) {
108 | return Set.of(e1, e2, e3, e4, e5, e6, e7, e8, e9, e10);
109 | }
110 |
111 | @SafeVarargs
112 | @Override
113 | public final Set of(E... elements) {
114 | return Set.of(elements);
115 | }
116 | //endregion
117 | }
118 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.jdk10/src/main/java/pl/tlinkowski/unij/service/collect/jdk10/Jdk10UnmodifiableListFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.jdk10;
19 |
20 | import java.util.Collection;
21 | import java.util.List;
22 | import java.util.stream.Collector;
23 | import java.util.stream.Collectors;
24 |
25 | import com.google.auto.service.AutoService;
26 |
27 | import pl.tlinkowski.unij.service.api.UniJService;
28 | import pl.tlinkowski.unij.service.api.collect.UnmodifiableListFactory;
29 |
30 | /**
31 | * Implementation of {@link UnmodifiableListFactory} that returns unmodifiable
32 | * lists introduced in JDK 10.
33 | *
34 | * @author Tomasz Linkowski
35 | */
36 | @UniJService(priority = 10)
37 | @AutoService(UnmodifiableListFactory.class)
38 | public final class Jdk10UnmodifiableListFactory implements UnmodifiableListFactory {
39 |
40 | //region COLLECTOR
41 | @Override
42 | public Collector> collector() {
43 | return Collectors.toUnmodifiableList();
44 | }
45 | //endregion
46 |
47 | //region COPY OF
48 | @Override
49 | public List copyOf(Collection extends E> coll) {
50 | return List.copyOf(coll);
51 | }
52 | //endregion
53 |
54 | //region OF
55 | @Override
56 | public List of() {
57 | return List.of();
58 | }
59 |
60 | @Override
61 | public List of(E e1) {
62 | return List.of(e1);
63 | }
64 |
65 | @Override
66 | public List of(E e1, E e2) {
67 | return List.of(e1, e2);
68 | }
69 |
70 | @Override
71 | public List of(E e1, E e2, E e3) {
72 | return List.of(e1, e2, e3);
73 | }
74 |
75 | @Override
76 | public List of(E e1, E e2, E e3, E e4) {
77 | return List.of(e1, e2, e3, e4);
78 | }
79 |
80 | @Override
81 | public List of(E e1, E e2, E e3, E e4, E e5) {
82 | return List.of(e1, e2, e3, e4, e5);
83 | }
84 |
85 | @Override
86 | public List of(E e1, E e2, E e3, E e4, E e5, E e6) {
87 | return List.of(e1, e2, e3, e4, e5, e6);
88 | }
89 |
90 | @Override
91 | public List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7) {
92 | return List.of(e1, e2, e3, e4, e5, e6, e7);
93 | }
94 |
95 | @Override
96 | public List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8) {
97 | return List.of(e1, e2, e3, e4, e5, e6, e7, e8);
98 | }
99 |
100 | @Override
101 | public List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9) {
102 | return List.of(e1, e2, e3, e4, e5, e6, e7, e8, e9);
103 | }
104 |
105 | @SuppressWarnings("PMD.ExcessiveParameterList")
106 | @Override
107 | public List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10) {
108 | return List.of(e1, e2, e3, e4, e5, e6, e7, e8, e9, e10);
109 | }
110 |
111 | @SafeVarargs
112 | @Override
113 | public final List of(E... elements) {
114 | return List.of(elements);
115 | }
116 | //endregion
117 | }
118 |
--------------------------------------------------------------------------------
/subprojects/bindings/collect/pl.tlinkowski.unij.service.collect.guava/src/main/java/pl/tlinkowski/unij/service/collect/guava/GuavaUnmodifiableListFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.collect.guava;
19 |
20 | import java.util.Collection;
21 | import java.util.List;
22 | import java.util.stream.Collector;
23 |
24 | import com.google.auto.service.AutoService;
25 | import com.google.common.collect.ImmutableList;
26 |
27 | import pl.tlinkowski.unij.service.api.UniJService;
28 | import pl.tlinkowski.unij.service.api.collect.UnmodifiableListFactory;
29 |
30 | /**
31 | * Implementation of {@link UnmodifiableListFactory} that returns Guava's {@link ImmutableList}s.
32 | *
33 | * @author Tomasz Linkowski
34 | */
35 | @UniJService(priority = 20)
36 | @AutoService(UnmodifiableListFactory.class)
37 | public final class GuavaUnmodifiableListFactory implements UnmodifiableListFactory {
38 |
39 | //region COLLECTOR
40 | @SuppressWarnings("unchecked")
41 | @Override
42 | public Collector> collector() {
43 | return (Collector>) (Collector) ImmutableList.toImmutableList();
44 | }
45 | //endregion
46 |
47 | //region COPY OF
48 | @Override
49 | public List copyOf(Collection extends E> coll) {
50 | return ImmutableList.copyOf(coll);
51 | }
52 | //endregion
53 |
54 | //region OF
55 | @Override
56 | public List of() {
57 | return ImmutableList.of();
58 | }
59 |
60 | @Override
61 | public List of(E e1) {
62 | return ImmutableList.of(e1);
63 | }
64 |
65 | @Override
66 | public List of(E e1, E e2) {
67 | return ImmutableList.of(e1, e2);
68 | }
69 |
70 | @Override
71 | public List of(E e1, E e2, E e3) {
72 | return ImmutableList.of(e1, e2, e3);
73 | }
74 |
75 | @Override
76 | public List of(E e1, E e2, E e3, E e4) {
77 | return ImmutableList.of(e1, e2, e3, e4);
78 | }
79 |
80 | @Override
81 | public List of(E e1, E e2, E e3, E e4, E e5) {
82 | return ImmutableList.of(e1, e2, e3, e4, e5);
83 | }
84 |
85 | @Override
86 | public List of(E e1, E e2, E e3, E e4, E e5, E e6) {
87 | return ImmutableList.of(e1, e2, e3, e4, e5, e6);
88 | }
89 |
90 | @Override
91 | public List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7) {
92 | return ImmutableList.of(e1, e2, e3, e4, e5, e6, e7);
93 | }
94 |
95 | @Override
96 | public List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8) {
97 | return ImmutableList.of(e1, e2, e3, e4, e5, e6, e7, e8);
98 | }
99 |
100 | @Override
101 | public List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9) {
102 | return ImmutableList.of(e1, e2, e3, e4, e5, e6, e7, e8, e9);
103 | }
104 |
105 | @SuppressWarnings("PMD.ExcessiveParameterList")
106 | @Override
107 | public List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10) {
108 | return ImmutableList.of(e1, e2, e3, e4, e5, e6, e7, e8, e9, e10);
109 | }
110 |
111 | @SafeVarargs
112 | @Override
113 | public final List of(E... elements) {
114 | return ImmutableList.copyOf(elements);
115 | }
116 | //endregion
117 | }
118 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.service.api/src/main/java/pl/tlinkowski/unij/service/api/collect/UnmodifiableSetFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.api.collect;
19 |
20 | import java.util.Collection;
21 | import java.util.Set;
22 | import java.util.stream.Collector;
23 |
24 | import kotlin.annotations.jvm.ReadOnly;
25 |
26 | /**
27 | * Proxy for
28 | * unmodifiable
29 | * factory methods available in the {@link Set} interface.
30 | *
31 | * @author Tomasz Linkowski
32 | */
33 | public interface UnmodifiableSetFactory {
34 |
35 | //region COLLECTOR
36 |
37 | /**
38 | * Equivalent of {@link java.util.stream.Collectors#toUnmodifiableSet()}.
39 | */
40 | Collector> collector();
41 | //endregion
42 |
43 | //region COPY OF
44 |
45 | /**
46 | * Equivalent of {@link Set#copyOf(Collection)}.
47 | */
48 | @ReadOnly
49 | Set copyOf(@ReadOnly Collection extends E> coll);
50 | //endregion
51 |
52 | //region OF
53 |
54 | /**
55 | * Equivalent of {@link Set#of()}.
56 | */
57 | @ReadOnly
58 | Set of();
59 |
60 | /**
61 | * Equivalent of {@link Set#of(Object)}.
62 | */
63 | @ReadOnly
64 | Set of(E e1);
65 |
66 | /**
67 | * Equivalent of {@link Set#of(Object, Object)}.
68 | */
69 | @ReadOnly
70 | Set of(E e1, E e2);
71 |
72 | /**
73 | * Equivalent of {@link Set#of(Object, Object, Object)}.
74 | */
75 | @ReadOnly
76 | Set of(E e1, E e2, E e3);
77 |
78 | /**
79 | * Equivalent of {@link Set#of(Object, Object, Object, Object)}.
80 | */
81 | @ReadOnly
82 | Set of(E e1, E e2, E e3, E e4);
83 |
84 | /**
85 | * Equivalent of {@link Set#of(Object, Object, Object, Object, Object)}.
86 | */
87 | @ReadOnly
88 | Set of(E e1, E e2, E e3, E e4, E e5);
89 |
90 | /**
91 | * Equivalent of {@link Set#of(Object, Object, Object, Object, Object, Object)}.
92 | */
93 | @ReadOnly
94 | Set of(E e1, E e2, E e3, E e4, E e5, E e6);
95 |
96 | /**
97 | * Equivalent of {@link Set#of(Object, Object, Object, Object, Object, Object, Object)}.
98 | */
99 | @ReadOnly
100 | Set of(E e1, E e2, E e3, E e4, E e5, E e6, E e7);
101 |
102 | /**
103 | * Equivalent of {@link Set#of(Object, Object, Object, Object, Object, Object, Object, Object)}.
104 | */
105 | @ReadOnly
106 | Set of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8);
107 |
108 | /**
109 | * Equivalent of {@link Set#of(Object, Object, Object, Object, Object, Object, Object, Object, Object)}.
110 | */
111 | @ReadOnly
112 | Set of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9);
113 |
114 | /**
115 | * Equivalent of {@link Set#of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)}.
116 | */
117 | @SuppressWarnings("PMD.ExcessiveParameterList")
118 | @ReadOnly
119 | Set of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10);
120 |
121 | /**
122 | * Equivalent of {@link Set#of(Object[])}.
123 | */
124 | @SuppressWarnings("unchecked")
125 | @ReadOnly
126 | Set of(E... elements);
127 | //endregion
128 |
129 | }
130 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/test/groovy/pl/tlinkowski/unij/api/UniMapsSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.api
19 |
20 | import spock.lang.Specification
21 |
22 | /**
23 | * @author Tomasz Linkowski
24 | */
25 | class UniMapsSpec extends Specification {
26 |
27 | def "copyOf"(Map map) {
28 | expect:
29 | UniMaps.copyOf(map) == Map.copyOf(map)
30 | where:
31 | map | _
32 | [:] | _
33 | ["a": 1] | _
34 | ["a": 1, "b": 2] | _
35 | ["a": 1, "b": 2, "c": 3] | _
36 | }
37 |
38 | // region ENTRIES (corresponds to ENTRIES region of AbstractUnmodifiableMapFactorySpec)
39 | def "ofEntries(...)"() {
40 | given:
41 | def expected = Map.ofEntries(
42 | Map.entry("a", 1),
43 | Map.entry("b", 2),
44 | Map.entry("c", 3)
45 | )
46 | when:
47 | def actual = UniMaps.ofEntries(
48 | UniMaps.entry("a", 1),
49 | UniMaps.entry("b", 2),
50 | UniMaps.entry("c", 3)
51 | )
52 | then:
53 | actual == expected
54 | }
55 |
56 | def "entry"() {
57 | expect:
58 | UniMaps.entry("a", 1) == Map.entry("a", 1)
59 | }
60 | //endregion
61 |
62 | def "of(n=0)"() {
63 | expect:
64 | UniMaps.of() == Map.of()
65 | }
66 |
67 | def "of(n=1)"() {
68 | expect:
69 | UniMaps.of("a", 1) == Map.of("a", 1)
70 | }
71 |
72 | def "of(n=2)"() {
73 | expect:
74 | UniMaps.of("a", 1, "b", 2) == Map.of("a", 1, "b", 2)
75 | }
76 |
77 | def "of(n=3)"() {
78 | expect:
79 | UniMaps.of("a", 1, "b", 2, "c", 3) ==
80 | Map.of("a", 1, "b", 2, "c", 3)
81 | }
82 |
83 | def "of(n=4)"() {
84 | expect:
85 | UniMaps.of("a", 1, "b", 2, "c", 3, "d", 4) ==
86 | Map.of("a", 1, "b", 2, "c", 3, "d", 4)
87 | }
88 |
89 | def "of(n=5)"() {
90 | expect:
91 | UniMaps.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5) ==
92 | Map.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5)
93 | }
94 |
95 | def "of(n=6)"() {
96 | expect:
97 | UniMaps.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6) ==
98 | Map.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6)
99 | }
100 |
101 | def "of(n=7)"() {
102 | expect:
103 | UniMaps.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7) ==
104 | Map.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7)
105 | }
106 |
107 | def "of(n=8)"() {
108 | expect:
109 | UniMaps.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h", 8) ==
110 | Map.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h", 8)
111 | }
112 |
113 | def "of(n=9)"() {
114 | expect:
115 | UniMaps.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h", 8, "i", 9) ==
116 | Map.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h", 8, "i", 9)
117 | }
118 |
119 | def "of(n=10)"() {
120 | expect:
121 | UniMaps.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h", 8, "i", 9, "j", 10) ==
122 | Map.of("a", 1, "b", 2, "c", 3, "d", 4, "e", 5, "f", 6, "g", 7, "h", 8, "i", 9, "j", 10)
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/main/java/pl/tlinkowski/unij/api/UniJLoader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.api;
19 |
20 | import java.util.*;
21 | import java.util.function.Function;
22 | import java.util.stream.Collectors;
23 |
24 | import kotlin.annotations.jvm.Mutable;
25 | import kotlin.annotations.jvm.ReadOnly;
26 | import lombok.experimental.UtilityClass;
27 | import lombok.extern.slf4j.Slf4j;
28 |
29 | import pl.tlinkowski.unij.service.api.UniJService;
30 |
31 | /**
32 | * Loads UniJ services (used internally by {@link UniJ}).
33 | *
34 | * @author Tomasz Linkowski
35 | */
36 | @UtilityClass
37 | @Slf4j
38 | final class UniJLoader {
39 |
40 | static S load(Class serviceClass) {
41 | @Mutable List services = new ArrayList<>(4);
42 | ServiceLoader.load(serviceClass).forEach(services::add);
43 | validateLoadedServices(services, serviceClass);
44 | return selectService(services, serviceClass);
45 | }
46 |
47 | private static void validateLoadedServices(@ReadOnly Collection services, Class serviceClass) {
48 | if (services.isEmpty()) {
49 | throw new UniJException(String.format(
50 | "%s service implementation not found. "
51 | + "Ensure proper pl.tlinkowski.unij.service.* dependency is on the runtime classpath/modulepath",
52 | serviceClass.getName()
53 | ));
54 | }
55 | log.debug("{} service: found {}", serviceClass.getName(), services);
56 | }
57 |
58 | private static S selectService(@ReadOnly Collection services, Class serviceClass) {
59 | return selectService(buildPriorityServiceMap(services), serviceClass);
60 | }
61 |
62 | private static S selectService(@ReadOnly SortedMap priorityServiceMap, Class serviceClass) {
63 | Integer highestPriority = priorityServiceMap.firstKey();
64 | S highestPriorityService = priorityServiceMap.get(highestPriority);
65 |
66 | log.info(
67 | "{} service: selected {} (priority={})",
68 | serviceClass.getName(), className(highestPriorityService), highestPriority
69 | );
70 | return highestPriorityService;
71 | }
72 |
73 | @ReadOnly
74 | private static SortedMap buildPriorityServiceMap(@ReadOnly Collection extends S> services) {
75 | return services.stream().collect(Collectors.toMap(
76 | UniJLoader::detectPriority, Function.identity(), UniJLoader::throwOnDuplicatePriority, TreeMap::new
77 | ));
78 | }
79 |
80 | private static int detectPriority(Object service) {
81 | UniJService uniJServiceAnn = service.getClass().getAnnotation(UniJService.class);
82 | if (uniJServiceAnn == null) {
83 | throw new UniJException(String.format(
84 | "Service implementation %s not annotated with @%s", className(service), UniJService.class.getSimpleName()
85 | ));
86 | }
87 | return uniJServiceAnn.priority();
88 | }
89 |
90 | private static S throwOnDuplicatePriority(S service1, S service2) {
91 | throw new UniJException(String.format(
92 | "%s and %s have the same priority", className(service1), className(service2)
93 | ));
94 | }
95 |
96 | private static String className(Object object) {
97 | return object.getClass().getName();
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.service.api/src/main/java/pl/tlinkowski/unij/service/api/collect/UnmodifiableListFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.service.api.collect;
19 |
20 | import java.util.Collection;
21 | import java.util.List;
22 | import java.util.stream.Collector;
23 |
24 | import kotlin.annotations.jvm.ReadOnly;
25 |
26 | /**
27 | * Proxy for
28 | * unmodifiable
29 | * factory methods available in the {@link List} interface.
30 | *
31 | * @author Tomasz Linkowski
32 | */
33 | public interface UnmodifiableListFactory {
34 |
35 | //region COLLECTOR
36 |
37 | /**
38 | * Equivalent of {@link java.util.stream.Collectors#toUnmodifiableList()}.
39 | */
40 | Collector> collector();
41 | //endregion
42 |
43 | //region COPY OF
44 |
45 | /**
46 | * Equivalent of {@link List#copyOf(Collection)}.
47 | */
48 | @ReadOnly
49 | List copyOf(@ReadOnly Collection extends E> coll);
50 | //endregion
51 |
52 | //region OF
53 |
54 | /**
55 | * Equivalent of {@link List#of()}.
56 | */
57 | @ReadOnly
58 | List of();
59 |
60 | /**
61 | * Equivalent of {@link List#of(Object)}.
62 | */
63 | @ReadOnly
64 | List of(E e1);
65 |
66 | /**
67 | * Equivalent of {@link List#of(Object, Object)}.
68 | */
69 | @ReadOnly
70 | List of(E e1, E e2);
71 |
72 | /**
73 | * Equivalent of {@link List#of(Object, Object, Object)}.
74 | */
75 | @ReadOnly
76 | List of(E e1, E e2, E e3);
77 |
78 | /**
79 | * Equivalent of {@link List#of(Object, Object, Object, Object)}.
80 | */
81 | @ReadOnly
82 | List of(E e1, E e2, E e3, E e4);
83 |
84 | /**
85 | * Equivalent of {@link List#of(Object, Object, Object, Object, Object)}.
86 | */
87 | @ReadOnly
88 | List of(E e1, E e2, E e3, E e4, E e5);
89 |
90 | /**
91 | * Equivalent of {@link List#of(Object, Object, Object, Object, Object, Object)}.
92 | */
93 | @ReadOnly
94 | List of(E e1, E e2, E e3, E e4, E e5, E e6);
95 |
96 | /**
97 | * Equivalent of {@link List#of(Object, Object, Object, Object, Object, Object, Object)}.
98 | */
99 | @ReadOnly
100 | List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7);
101 |
102 | /**
103 | * Equivalent of {@link List#of(Object, Object, Object, Object, Object, Object, Object, Object)}.
104 | */
105 | @ReadOnly
106 | List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8);
107 |
108 | /**
109 | * Equivalent of {@link List#of(Object, Object, Object, Object, Object, Object, Object, Object, Object)}.
110 | */
111 | @ReadOnly
112 | List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9);
113 |
114 | /**
115 | * Equivalent of {@link List#of(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)}.
116 | */
117 | @SuppressWarnings("PMD.ExcessiveParameterList")
118 | @ReadOnly
119 | List of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10);
120 |
121 | /**
122 | * Equivalent of {@link List#of(Object[])}.
123 | */
124 | @SuppressWarnings("unchecked")
125 | @ReadOnly
126 | List of(E... elements);
127 | //endregion
128 | }
129 |
--------------------------------------------------------------------------------
/subprojects/api/pl.tlinkowski.unij.api/src/test/groovy/pl/tlinkowski/unij/api/UniCollectorsSpec.groovy:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | *
4 | * Copyright 2018-2021 Tomasz Linkowski.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | package pl.tlinkowski.unij.api
19 |
20 | import spock.lang.Specification
21 |
22 | import java.util.stream.Collectors
23 | import java.util.stream.Stream
24 |
25 | /**
26 | * @author Tomasz Linkowski
27 | */
28 | class UniCollectorsSpec extends Specification {
29 |
30 | def "toUnmodifiableList()"(List list) {
31 | expect:
32 | list.stream().collect(UniCollectors.toUnmodifiableList()) == list
33 | where:
34 | list | _
35 | [] | _
36 | [1] | _
37 | [1, 2] | _
38 | [1, 2, 3] | _
39 | }
40 |
41 | def "toUnmodifiableSet()"(Set set) {
42 | expect:
43 | set.stream().collect(UniCollectors.toUnmodifiableSet()) == set
44 | where:
45 | set | _
46 | [] | _
47 | [1] | _
48 | [1, 2] | _
49 | [1, 2, 3] | _
50 | }
51 |
52 | //region TO UNMODIFIABLE MAP (excerpt from AbstractUnmodifiableMapFactorySpec)
53 | def "toUnmodifiableMap(keyMapper,valueMapper)"(Map map) {
54 | given:
55 | def entryStream = map.entrySet().stream()
56 | def collector = UniCollectors.toUnmodifiableMap({ it.getKey() }, { it.getValue() })
57 | expect:
58 | entryStream.collect(collector) == map
59 | where:
60 | map | _
61 | [:] | _
62 | ["a": 1] | _
63 | ["a": 1, "b": 2] | _
64 | ["a": 1, "b": 2, "c": 3] | _
65 | }
66 |
67 | def "toUnmodifiableMap(keyMapper,valueMapper,mergeFunction)"(List