From f6184e82a135d455a9fc909a9f8e7fe0bfb63dbc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Ho=C3=9F?= Date: Sat, 29 Oct 2022 11:45:39 +0200 Subject: [PATCH] update project meta --- .editorconfig | 19 ++ .gitattributes | 24 ++ .github/workflows/codeql-analysis.yml | 48 +++ .github/workflows/release.yml | 57 ++++ .github/workflows/reuse.yml | 16 + .github/workflows/update-parent.yml | 41 +++ .gitignore | 145 +++++++- .idea/.name | 1 + .idea/codeStyles/Project.xml | 19 ++ .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/copyright/profiles_settings.xml | 10 + .idea/copyright/storage_units.xml | 7 + .idea/inspectionProfiles/profiles_settings.xml | 6 + .idea/inspectionProfiles/storage-units.xml | 66 ++++ .mailmap | 8 + .reuse/dep5 | 8 + AUTHORS.md | 14 + CITATION.cff | 20 ++ CODE_OF_CONDUCT.md | 133 ++++++++ CONTRIBUTING.md | 36 ++ LICENSE | 131 +------ LICENSES/0BSD.txt | 10 + Makefile | 34 ++ README.asciidoc => README.md | 377 +++++++-------------- SECURITY.md | 14 + java.properties | 4 + maven-version-rules.xml | 30 +- pom.xml | 179 ++++++---- storage-units-dozer/pom.xml | 14 +- storage-units-dozer/src/main/java/module-info.java | 6 +- .../dozer/BinaryStorageUnitConverter.java | 6 +- .../dozer/DecimalStorageUnitConverter.java | 6 +- .../wtf/metio/storageunits/dozer/package-info.java | 18 +- storage-units-eclipselink/pom.xml | 14 +- .../src/main/java/module-info.java | 6 +- .../eclipselink/AbstractStorageUnitConverter.java | 6 +- .../eclipselink/BinaryStorageUnitConverter.java | 6 +- .../eclipselink/DecimalStorageUnitConverter.java | 6 +- .../storageunits/eclipselink/package-info.java | 22 +- .../eclipselink/StorageUnitConverterTest.java | 64 ---- storage-units-jackson/pom.xml | 14 +- .../src/main/java/module-info.java | 4 + .../jackson/BinaryStorageUnitDeserializer.java | 6 +- .../jackson/DecimalStorageUnitDeserializer.java | 6 +- .../storageunits/jackson/StorageUnitModule.java | 6 +- .../jackson/UnwrappingStorageUnitSerializer.java | 6 +- .../metio/storageunits/jackson/package-info.java | 22 +- .../jackson/JacksonBinaryDeserializationTest.java | 6 +- .../jackson/JacksonDecimalDeserializationTest.java | 6 +- .../jackson/JacksonDefaultDeserializationTest.java | 6 +- .../jackson/JacksonSerializationTest.java | 6 +- .../jackson/PreferredUnitTypeTest.java | 6 +- storage-units-jakarta/pom.xml | 14 +- .../src/main/java/module-info.java | 6 +- .../jakarta/AbstractStorageUnitConverter.java | 6 +- .../jakarta/BinaryStorageUnitConverter.java | 6 +- .../jakarta/DecimalStorageUnitConverter.java | 6 +- .../metio/storageunits/jakarta/package-info.java | 22 +- .../jakarta/StorageUnitConverterTest.java | 64 ---- storage-units-mapstruct/pom.xml | 14 +- .../src/main/java/module-info.java | 6 +- .../mapstruct/BigIntegerToBinaryUnitMapper.java | 6 +- .../mapstruct/BigIntegerToDecimalUnitMapper.java | 6 +- .../mapstruct/LongToBinaryUnitMapper.java | 6 +- .../mapstruct/LongToDecimalUnitMapper.java | 6 +- .../mapstruct/StorageUnitToBigIntegerMapper.java | 6 +- .../metio/storageunits/mapstruct/package-info.java | 18 +- storage-units-model/pom.xml | 8 +- storage-units-model/src/main/java/module-info.java | 4 + .../java/wtf/metio/storageunits/model/Byte.java | 6 +- .../java/wtf/metio/storageunits/model/Exabyte.java | 6 +- .../wtf/metio/storageunits/model/Exbibyte.java | 6 +- .../wtf/metio/storageunits/model/FormatUtils.java | 6 +- .../wtf/metio/storageunits/model/Gibibyte.java | 6 +- .../wtf/metio/storageunits/model/Gigabyte.java | 6 +- .../wtf/metio/storageunits/model/Kibibyte.java | 6 +- .../wtf/metio/storageunits/model/Kilobyte.java | 6 +- .../wtf/metio/storageunits/model/Mebibyte.java | 6 +- .../wtf/metio/storageunits/model/Megabyte.java | 6 +- .../wtf/metio/storageunits/model/Pebibyte.java | 6 +- .../wtf/metio/storageunits/model/Petabyte.java | 6 +- .../wtf/metio/storageunits/model/StorageUnit.java | 10 +- .../wtf/metio/storageunits/model/StorageUnits.java | 6 +- .../wtf/metio/storageunits/model/Tebibyte.java | 6 +- .../wtf/metio/storageunits/model/Terabyte.java | 6 +- .../wtf/metio/storageunits/model/Yobibyte.java | 6 +- .../wtf/metio/storageunits/model/Yottabyte.java | 6 +- .../wtf/metio/storageunits/model/Zebibyte.java | 6 +- .../wtf/metio/storageunits/model/Zettabyte.java | 6 +- .../wtf/metio/storageunits/model/package-info.java | 6 +- .../metio/storageunits/model/FormatUtilsTest.java | 6 +- .../storageunits/model/ReadmeConversionsTest.java | 6 +- .../storageunits/model/ReadmeFormattingTest.java | 6 +- .../model/StorageUnitArithmeticBigIntegerTest.java | 6 +- .../model/StorageUnitArithmeticLongTest.java | 6 +- .../model/StorageUnitCompareToTest.java | 6 +- .../model/StorageUnitConversionTest.java | 6 +- .../model/StorageUnitExpressionTest.java | 6 +- .../model/StorageUnitFormattingTest.java | 6 +- .../model/StorageUnitNumberOfBytesPerUnitTest.java | 6 +- .../storageunits/model/StorageUnitNumberTest.java | 6 +- .../metio/storageunits/model/StorageUnitTest.java | 6 +- .../model/StorageUnitToStringTest.java | 6 +- .../model/StorageUnitsBigBinaryTest.java | 6 +- .../model/StorageUnitsBigDecimalTest.java | 6 +- .../model/StorageUnitsFormattingTest.java | 6 +- .../StorageUnitsFormattingWithAnyFormatTest.java | 6 +- .../StorageUnitsFormattingWithDefaultsTest.java | 6 +- ...ageUnitsFormattingWithPatternAndLocaleTest.java | 6 +- .../StorageUnitsFormattingWithPatternTest.java | 6 +- .../metio/storageunits/model/StorageUnitsTest.java | 6 +- .../model/StorageUnitsWithBigIntegerTest.java | 6 +- .../model/StorageUnitsWithLongTest.java | 6 +- .../wtf/metio/storageunits/model/TestObjects.java | 6 +- .../wtf/metio/storageunits/model/TestUtils.java | 6 +- storage-units-modelmapper/pom.xml | 14 +- .../src/main/java/module-info.java | 6 +- .../metio/storageunits/jakarta/package-info.java | 10 - .../BigIntegerToBinaryUnitConverter.java | 8 +- .../BigIntegerToDecimalUnitConverter.java | 8 +- .../LongToBinaryUnitConverter.java | 8 +- .../LongToDecimalUnitConverter.java | 8 +- .../StorageUnitToBigIntegerConverter.java | 8 +- .../storageunits/modelmapper/package-info.java | 8 + .../jakarta/StorageUnitConverterTest.java | 64 ---- storage-units-mongodb/pom.xml | 14 +- .../src/main/java/module-info.java | 6 +- .../mongodb/AbstractStorageUnitCodec.java | 6 +- .../mongodb/BinaryStorageUnitCodec.java | 6 +- .../mongodb/DecimalStorageUnitCodec.java | 6 +- .../metio/storageunits/mongodb/package-info.java | 22 +- .../storageunits/mongodb/StorageUnitCodecTest.java | 5 + storage-units-orika/pom.xml | 16 +- storage-units-orika/src/main/java/module-info.java | 7 +- .../orika/AbstractStorageUnitConverter.java | 10 +- .../orika/BinaryStorageUnitConverter.java | 10 +- .../orika/DecimalStorageUnitConverter.java | 10 +- .../wtf/metio/storageunits/orika/package-info.java | 18 +- 138 files changed, 1331 insertions(+), 1161 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/reuse.yml create mode 100644 .github/workflows/update-parent.yml rewrite .gitignore (91%) mode change 100755 => 100644 create mode 100644 .idea/.name create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/copyright/profiles_settings.xml create mode 100644 .idea/copyright/storage_units.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/inspectionProfiles/storage-units.xml create mode 100644 .mailmap create mode 100644 .reuse/dep5 create mode 100644 AUTHORS.md create mode 100644 CITATION.cff create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md rewrite LICENSE (99%) create mode 100644 LICENSES/0BSD.txt create mode 100644 Makefile rename README.asciidoc => README.md (50%) mode change 100755 => 100644 create mode 100644 SECURITY.md create mode 100644 java.properties rewrite maven-version-rules.xml (72%) rewrite pom.xml (96%) rewrite storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/package-info.java (78%) rewrite storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/package-info.java (67%) delete mode 100644 storage-units-eclipselink/src/test/java/wtf/metio/storageunits/eclipselink/StorageUnitConverterTest.java rewrite storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/package-info.java (68%) rewrite storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/package-info.java (63%) delete mode 100644 storage-units-jakarta/src/test/java/wtf/metio/storageunits/jakarta/StorageUnitConverterTest.java rewrite storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/package-info.java (79%) delete mode 100644 storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/package-info.java rename storage-units-modelmapper/src/main/java/wtf/metio/storageunits/{jakarta => modelmapper}/BigIntegerToBinaryUnitConverter.java (53%) rename storage-units-modelmapper/src/main/java/wtf/metio/storageunits/{jakarta => modelmapper}/BigIntegerToDecimalUnitConverter.java (53%) rename storage-units-modelmapper/src/main/java/wtf/metio/storageunits/{jakarta => modelmapper}/LongToBinaryUnitConverter.java (50%) rename storage-units-modelmapper/src/main/java/wtf/metio/storageunits/{jakarta => modelmapper}/LongToDecimalUnitConverter.java (51%) rename storage-units-modelmapper/src/main/java/wtf/metio/storageunits/{jakarta => modelmapper}/StorageUnitToBigIntegerConverter.java (50%) create mode 100644 storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/package-info.java delete mode 100644 storage-units-modelmapper/src/test/java/wtf/metio/storageunits/jakarta/StorageUnitConverterTest.java rewrite storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/package-info.java (70%) rewrite storage-units-orika/src/main/java/wtf/metio/storageunits/orika/package-info.java (80%) diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..01c1951 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: The Storage-Units Authors +# SPDX-License-Identifier: 0BSD + +# top-most EditorConfig file +root = true + +# global rules for all fies +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true + +# Makefiles use tabs by convention +[Makefile] +indent_style = tab +[*.mk] +indent_style = tab diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..add218d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: The Storage-Units Authors +# SPDX-License-Identifier: 0BSD + +# Handle line endings automatically for files detected as text +# and leave all files detected as binary untouched. +* text=auto + +# +# The above will handle all files NOT found below +# +# These files are text and should be normalized (Convert crlf => lf) +*.css text +*.spec text +*.rb text +*.java text +*.js text +*.md text +*.properties text +*.txt text +*.yml text +*.yaml text +*.html text +*.xml text +*.rc text diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..74280ec --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: The Storage-Units Authors +# SPDX-License-Identifier: 0BSD + +name: CodeQL +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + - cron: 42 3 * * 5 +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + strategy: + fail-fast: false + matrix: + language: [ java ] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: 17 + java-package: jdk + architecture: x64 + distribution: temurin + - name: Cache Maven Artifacts + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b439e83 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +# SPDX-FileCopyrightText: The Storage-Units Authors +# SPDX-License-Identifier: 0BSD + +name: Automated Release +on: + schedule: + - cron: 27 4 * * TUE +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: temurin + server-id: ossrh + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + - uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Create release version + id: release + run: echo "::set-output name=version::$(date +'%Y.%-m.%-d')" + - name: Count commits in last week + id: commits + run: echo "::set-output name=count::$(git rev-list --count HEAD --since='last Tuesday')" + - name: Set release version + run: mvn --batch-mode versions:set -DnewVersion=${{ steps.release.outputs.version }} -DgenerateBackupPoms=false + - id: gpg + if: steps.commits.outputs.count > 0 + name: GPG Key + run: echo "${{ secrets.GPG_SECRET_KEY_BASE64 }}" | base64 --decode > $GITHUB_WORKSPACE/signing.key.asc + - name: Publish to Maven Central + if: steps.commits.outputs.count > 0 + run: mvn --batch-mode --activate-profiles release deploy -Dpgp.secretkey=keyfile:$GITHUB_WORKSPACE/signing.key.asc -Dpgp.passphrase=literal:${{ secrets.GPG_SECRET_KEY_PASSWORD }} + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + - name: Create Release + if: steps.commits.outputs.count > 0 + id: create_release + uses: actions/create-release@v1.1.4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.release.outputs.version }} + release_name: ${{ steps.release.outputs.version }} + draft: false + prerelease: false + body: | + Automated release, see [commits](https://github.com/metio/storage-units/commits/${{ steps.release.outputs.version }}) for changes. diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml new file mode 100644 index 0000000..c34439b --- /dev/null +++ b/.github/workflows/reuse.yml @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: The Storage-Units Authors +# SPDX-License-Identifier: 0BSD + +name: REUSE compliance +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: REUSE Compliance Check + uses: fsfe/reuse-action@v1 diff --git a/.github/workflows/update-parent.yml b/.github/workflows/update-parent.yml new file mode 100644 index 0000000..6b30099 --- /dev/null +++ b/.github/workflows/update-parent.yml @@ -0,0 +1,41 @@ +# SPDX-FileCopyrightText: The Storage-Units Authors +# SPDX-License-Identifier: 0BSD + +name: Update Parent +on: + schedule: + - cron: 0 1 5 * * +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: 17 + java-package: jdk + architecture: x64 + distribution: temurin + - uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Update Parent + run: mvn --batch-mode versions:update-parent --define generateBackupPoms=false + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update parent to latest version + committer: GitHub + author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + title: Update parent to latest version + body: | + `mvn --batch-mode versions:update-parent -DgenerateBackupPoms=false` + assignees: | + sebhoss + draft: false + branch: update-parent diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 dissimilarity index 91% index 8f44daf..73af608 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,137 @@ -.settings/ -target/ -.classpath -.project -.pmd -.pmdruleset.xml -.ansible-git-* -.flattened-pom.xml +# SPDX-FileCopyrightText: The Storage-Units Authors +# SPDX-License-Identifier: 0BSD + +######################################################################################################################## +# Java GitIgnore # +# Based on: https://github.com/toptal/gitignore/blob/master/templates/Java.gitignore # +######################################################################################################################## + +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + +######################################################################################################################## +# Maven GitIgnore # +# Based on: https://github.com/toptal/gitignore/blob/master/templates/Maven.gitignore # +######################################################################################################################## + +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties + +######################################################################################################################## +# JetBrains IntelliJ IDEA GitIgnore # +# Based on: https://github.com/toptal/gitignore/blob/master/templates/JetBrains.gitignore # +######################################################################################################################## + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/misc.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/dataSources.xml +.idea/**/sqlDataSources.xml +.idea/**/sqldialects.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Random stuff +.idea/**/libraries-with-intellij-classes.xml +.idea/**/encodings.xml + +# Markdown +.idea/markdown.xml + +# VCS +.idea/vcs.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +.idea/artifacts +.idea/compiler.xml +.idea/jarRepositories.xml +.idea/modules.xml +.idea/*.iml +.idea/modules +*.iml +*.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..3e32123 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +storage-units \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..0221931 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,19 @@ + + + + diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..0f7bc51 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..d203042 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/.idea/copyright/storage_units.xml b/.idea/copyright/storage_units.xml new file mode 100644 index 0000000..5eab873 --- /dev/null +++ b/.idea/copyright/storage_units.xml @@ -0,0 +1,7 @@ + + + + diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..5c42f41 --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + diff --git a/.idea/inspectionProfiles/storage-units.xml b/.idea/inspectionProfiles/storage-units.xml new file mode 100644 index 0000000..f1ef9c1 --- /dev/null +++ b/.idea/inspectionProfiles/storage-units.xml @@ -0,0 +1,66 @@ + + + + diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000..410c01c --- /dev/null +++ b/.mailmap @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: The Storage-Units Authors +# SPDX-License-Identifier: 0BSD + +Sebastian Hoß +Sebastian Hoß +Sebastian Hoß +Sebastian Hoß +Sebastian Hoß diff --git a/.reuse/dep5 b/.reuse/dep5 new file mode 100644 index 0000000..6d974ab --- /dev/null +++ b/.reuse/dep5 @@ -0,0 +1,8 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Storage-Units +Upstream-Contact: Sebastian Hoß +Source: https://github.com/metio/storage-units + +Files: .idea/* +Copyright: The Storage-Units Authors +License: 0BSD diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 0000000..9496155 --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,14 @@ + + +# Authors + +This file list all authors of this project. You can add yourself to this list once you contributed a path to the project. + +## Owners + +Owners have administrator access to the project. + +- Sebastian Hoß diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..67832c5 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: The Storage-Units Authors +# SPDX-License-Identifier: 0BSD + +cff-version: 1.2.0 +title: Storage-Units +message: If you use this software, please cite it as below. +type: software +authors: +- family-names: Hoß + given-names: Sebastian + email: seb@hoß.de +url: https://github.com/metio/storage-units +license: 0BSD +keywords: + - converter + - java + - make + - maven + - storage + - units diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..2a71057 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,133 @@ + + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, +and learning from the experience +* Focusing on what is best not just for us as individuals, but for the +overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or +advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email +address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a +professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +abuse@metio.wtf. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f97240a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,36 @@ + + +# Contributor Guide + +Thank you so much for helping out! This project uses a [DCO](https://developercertificate.org/) to verify that each change is legally acceptable. Its text is as follows: + +``` +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. +``` + +In order to sign this DCO, simply use `git commit --signoff` while working on this project. diff --git a/LICENSE b/LICENSE dissimilarity index 99% index 0e259d4..ac85e0e 100755 --- a/LICENSE +++ b/LICENSE @@ -1,121 +1,10 @@ -Creative Commons Legal Code - -CC0 1.0 Universal - - CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE - LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN - ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS - INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES - REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS - PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM - THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED - HEREUNDER. - -Statement of Purpose - -The laws of most jurisdictions throughout the world automatically confer -exclusive Copyright and Related Rights (defined below) upon the creator -and subsequent owner(s) (each and all, an "owner") of an original work of -authorship and/or a database (each, a "Work"). - -Certain owners wish to permanently relinquish those rights to a Work for -the purpose of contributing to a commons of creative, cultural and -scientific works ("Commons") that the public can reliably and without fear -of later claims of infringement build upon, modify, incorporate in other -works, reuse and redistribute as freely as possible in any form whatsoever -and for any purposes, including without limitation commercial purposes. -These owners may contribute to the Commons to promote the ideal of a free -culture and the further production of creative, cultural and scientific -works, or to gain reputation or greater distribution for their Work in -part through the use and efforts of others. - -For these and/or other purposes and motivations, and without any -expectation of additional consideration or compensation, the person -associating CC0 with a Work (the "Affirmer"), to the extent that he or she -is an owner of Copyright and Related Rights in the Work, voluntarily -elects to apply CC0 to the Work and publicly distribute the Work under its -terms, with knowledge of his or her Copyright and Related Rights in the -Work and the meaning and intended legal effect of CC0 on those rights. - -1. Copyright and Related Rights. A Work made available under CC0 may be -protected by copyright and related or neighboring rights ("Copyright and -Related Rights"). Copyright and Related Rights include, but are not -limited to, the following: - - i. the right to reproduce, adapt, distribute, perform, display, - communicate, and translate a Work; - ii. moral rights retained by the original author(s) and/or performer(s); -iii. publicity and privacy rights pertaining to a person's image or - likeness depicted in a Work; - iv. rights protecting against unfair competition in regards to a Work, - subject to the limitations in paragraph 4(a), below; - v. rights protecting the extraction, dissemination, use and reuse of data - in a Work; - vi. database rights (such as those arising under Directive 96/9/EC of the - European Parliament and of the Council of 11 March 1996 on the legal - protection of databases, and under any national implementation - thereof, including any amended or successor version of such - directive); and -vii. other similar, equivalent or corresponding rights throughout the - world based on applicable law or treaty, and any national - implementations thereof. - -2. Waiver. To the greatest extent permitted by, but not in contravention -of, applicable law, Affirmer hereby overtly, fully, permanently, -irrevocably and unconditionally waives, abandons, and surrenders all of -Affirmer's Copyright and Related Rights and associated claims and causes -of action, whether now known or unknown (including existing as well as -future claims and causes of action), in the Work (i) in all territories -worldwide, (ii) for the maximum duration provided by applicable law or -treaty (including future time extensions), (iii) in any current or future -medium and for any number of copies, and (iv) for any purpose whatsoever, -including without limitation commercial, advertising or promotional -purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each -member of the public at large and to the detriment of Affirmer's heirs and -successors, fully intending that such Waiver shall not be subject to -revocation, rescission, cancellation, termination, or any other legal or -equitable action to disrupt the quiet enjoyment of the Work by the public -as contemplated by Affirmer's express Statement of Purpose. - -3. Public License Fallback. Should any part of the Waiver for any reason -be judged legally invalid or ineffective under applicable law, then the -Waiver shall be preserved to the maximum extent permitted taking into -account Affirmer's express Statement of Purpose. In addition, to the -extent the Waiver is so judged Affirmer hereby grants to each affected -person a royalty-free, non transferable, non sublicensable, non exclusive, -irrevocable and unconditional license to exercise Affirmer's Copyright and -Related Rights in the Work (i) in all territories worldwide, (ii) for the -maximum duration provided by applicable law or treaty (including future -time extensions), (iii) in any current or future medium and for any number -of copies, and (iv) for any purpose whatsoever, including without -limitation commercial, advertising or promotional purposes (the -"License"). The License shall be deemed effective as of the date CC0 was -applied by Affirmer to the Work. Should any part of the License for any -reason be judged legally invalid or ineffective under applicable law, such -partial invalidity or ineffectiveness shall not invalidate the remainder -of the License, and in such case Affirmer hereby affirms that he or she -will not (i) exercise any of his or her remaining Copyright and Related -Rights in the Work or (ii) assert any associated claims and causes of -action with respect to the Work, in either case contrary to Affirmer's -express Statement of Purpose. - -4. Limitations and Disclaimers. - - a. No trademark or patent rights held by Affirmer are waived, abandoned, - surrendered, licensed or otherwise affected by this document. - b. Affirmer offers the Work as-is and makes no representations or - warranties of any kind concerning the Work, express, implied, - statutory or otherwise, including without limitation warranties of - title, merchantability, fitness for a particular purpose, non - infringement, or the absence of latent or other defects, accuracy, or - the present or absence of errors, whether or not discoverable, all to - the greatest extent permissible under applicable law. - c. Affirmer disclaims responsibility for clearing rights of other persons - that may apply to the Work or any use thereof, including without - limitation any person's Copyright and Related Rights in the Work. - Further, Affirmer disclaims responsibility for obtaining any necessary - consents, permissions or other rights required for any use of the - Work. - d. Affirmer understands and acknowledges that Creative Commons is not a - party to this document and has no duty or obligation with respect to - this CC0 or use of the Work. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/LICENSES/0BSD.txt b/LICENSES/0BSD.txt new file mode 100644 index 0000000..7a2c888 --- /dev/null +++ b/LICENSES/0BSD.txt @@ -0,0 +1,10 @@ +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1ff8107 --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +# SPDX-FileCopyrightText: The Storage-Units Authors +# SPDX-License-Identifier: 0BSD + +############################################################################### +# PROLOGUE # +############################################################################### +MAKEFLAGS += --warn-undefined-variables +MAKEFLAGS += --no-builtin-rules +.ONESHELL: +.DELETE_ON_ERROR: +.DEFAULT_GOAL := help +ifneq ($(strip $(shell which zsh)),) + SHELL := zsh + .SHELLFLAGS += -o pipefail +else ifneq ($(strip $(shell which bash)),) + SHELL := bash + .SHELLFLAGS += -o pipefail +else + SHELL := sh +endif + +############################################################################### +# COMMON RULES # +############################################################################### + +##@ other +.PHONY: help +help: ## Display this help message + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) + +############################################################################### +# PROJECT SPECIFIC RULES # +############################################################################### +-include project.mk diff --git a/README.asciidoc b/README.md old mode 100755 new mode 100644 similarity index 50% rename from README.asciidoc rename to README.md index e56d643..4d8a558 --- a/README.asciidoc +++ b/README.md @@ -1,216 +1,101 @@ -= Storage-Units image:https://img.shields.io/badge/email-%40metio-brightgreen.svg?style=social&label=mail["Discuss on Google Groups", link="https://groups.google.com/forum/#!forum/metio"] image:https://img.shields.io/badge/irc-%23metio.wtf-brightgreen.svg?style=social&label=IRC["Chat on IRC", link="http://webchat.freenode.net/?channels=metio.wtf"] -Sebastian Hoß -:github-org: sebhoss -:project-name: storage-units -:project-group: de.xn--ho-hia.storage_units -:coverity-project: 2658 -:codacy-project: d3cfbbc415c14b79a661d573ac11e68c -:toc: -:toc-placement: preamble - -image:https://img.shields.io/badge/license-cc%20zero-000000.svg?style=flat-square["CC Zero", link="http://creativecommons.org/publicdomain/zero/1.0/"] -pass:[Maven Central] -pass:[Read JavaDocs] -image:https://reposs.herokuapp.com/?path={github-org}/{project-name}&style=flat-square["Repository size"] -image:https://www.openhub.net/p/{project-name}/widgets/project_thin_badge.gif["Open Hub statistics", link="https://www.openhub.net/p/{project-name}"] - -image:https://img.shields.io/travis/{github-org}/{project-name}/master.svg?style=flat-square["Build Status", link="https://travis-ci.org/{github-org}/{project-name}"] -image:https://img.shields.io/coveralls/{github-org}/{project-name}/master.svg?style=flat-square["Code Coverage", link="https://coveralls.io/github/{github-org}/{project-name}"] -image:https://img.shields.io/coverity/scan/{coverity-project}.svg?style=flat-square["Coverity Scan Result", link="https://scan.coverity.com/projects/{github-org}-{project-name}"] -image:https://img.shields.io/codacy/grade/{codacy-project}.svg?style=flat-square["Codacy Code Quality", link="https://www.codacy.com/app/mail_7/{project-name}"] -image:https://img.shields.io/badge/forkable-yes-brightgreen.svg?style=flat-square["Can this project be forked?", link="https://basicallydan.github.io/forkability/?u={github-org}&r={project-name}"] -image:https://img.shields.io/maintenance/yes/.svg?style=flat-square["Is this thing still maintained?"] -image:https://img.shields.io/bountysource/team/metio/activity.svg?style=flat-square["Bounties on open tickets", link="https://www.bountysource.com/teams/metio"] - -https://www.java.com[Java] library for storage-/byte-units. All units defined in link:http://en.wikipedia.org/wiki/ISO/IEC_80000[ISO IEC 80000-13:2008] are supported, as well as other commonly found units, like 1 Kilobyte = 1024 Byte. - -=== Features + + +# Storage-Units + +Storage units according to ISO IEC 80000-13:2008 implemented in Java. + +## Features * Immutable, type- and thread-safe object model for storage units * Convenience factories to create units * Basic arithmetic operators * Comparisons and equality checks between units * Lossless conversion between all units -* Human readable text format, including custom formats +* Human-readable text format, including custom formats * Compatible with any `java.lang.Number` * Custom serializers for Jackson, MongoDB & EclipseLink -==== Available Units - -.Binary units -|=== -| Name | Symbol | Exponential | Absolute | Class - -| Byte -| B -| 2 ^0^ Byte -| 1 Byte -| `Byte` - -| Kibibyte -| KiB -| 2 ^10^ Byte -| 1 024 Byte -| `Kibibyte` - -| Mebibyte -| MiB -| 2 ^20^ Byte -| 1 048 576 Byte -| `Mebibyte` - -| Gibibyte -| GiB -| 2 ^30^ Byte -| 1 073 741 824 Byte -| `Gibibyte` - -| Tebibyte -| TiB -| 2 ^40^ Byte -| 1 099 511 627 776 Byte -| `Tebibyte` - -| Pebibyte -| PiB -| 2 ^50^ Byte -| 1 125 899 906 842 624 Byte -| `Pebibyte` - -| Exbibyte -| EiB -| 2 ^60^ Byte -| 1 152 921 504 606 846 976 Byte -| `Exbibyte` - -| Zebibyte -| ZiB -| 2 ^70^ Byte -| 1 180 591 620 717 411 303 424 Byte -| `Zebibyte` - -| Yobibyte -| YiB -| 2 ^80^ Byte -| 1 208 925 819 614 629 174 706 176 Byte -| `Yobibyte` -|=== - -.Decimal units -|=== -| Name | Symbol | Exponential | Absolute | Class - -| Byte -| B -| 10 ^0^ Byte -| 1 Byte -| `Byte` - -| Kilobyte -| kB -| 10 ^3^ Byte -| 1 000 Byte -| `Kilobyte` - -| Megabyte -| MB -| 10 ^6^ Byte -| 1 000 000 Byte -| `Megabyte` - -| Gigabyte -| GB -| 10 ^9^ Byte -| 1 000 000 000 Byte -| `Gigabyte` - -| Terabyte -| TB -| 10 ^12^ Byte -| 1 000 000 000 000 Byte -| `Terabyte` - -| Petabyte -| PB -| 10 ^15^ Byte -| 1 000 000 000 000 000 Byte -| `Petabyte` - -| Exabyte -| EB -| 10 ^18^ Byte -| 1 000 000 000 000 000 000 Byte -| `Exabyte` - -| Zettabyte -| ZB -| 10 ^21^ Byte -| 1 000 000 000 000 000 000 000 Byte -| `Zettabyte` - -| Yottabyte -| YB -| 10 ^24^ Byte -| 1 000 000 000 000 000 000 000 000 Byte -| `Yottabyte` -|=== - -== Usage - -=== Factories +### Available Units + +| Name | Symbol | Exponential | Absolute | +|----------|--------|---------------------|----------------------------------------| +| Byte | B | 20 Byte | 1 Byte | +| Kibibyte | KiB | 210 Byte | 1 024 Byte | +| Mebibyte | MiB | 220 Byte | 1 048 576 Byte | +| Gibibyte | GiB | 230 Byte | 1 073 741 824 Byte | +| Tebibyte | TiB | 240 Byte | 1 099 511 627 776 Byte | +| Pebibyte | PiB | 250 Byte | 1 125 899 906 842 624 Byte | +| Exbibyte | EiB | 260 Byte | 1 152 921 504 606 846 976 Byte | +| Zebibyte | ZiB | 270 Byte | 1 180 591 620 717 411 303 424 Byte | +| Yobibyte | YiB | 280 Byte | 1 208 925 819 614 629 174 706 176 Byte | + +| Name | Symbol | Exponential | Absolute | +|-----------|--------|----------------------|----------------------------------------| +| Byte | B | 100 Byte | 1 Byte | +| Kilobyte | KB | 103 Byte | 1 000 Byte | +| Megabyte | MB | 106 Byte | 1 000 000 Byte | +| Gigabyte | GB | 109 Byte | 1 000 000 000 Byte | +| Terabyte | TB | 1012 Byte | 1 000 000 000 000 Byte | +| Petabyte | PB | 1015 Byte | 1 000 000 000 000 000 Byte | +| Exabyte | EB | 1018 Byte | 1 000 000 000 000 000 000 Byte | +| Zettabyte | ZB | 1021 Byte | 1 000 000 000 000 000 000 000 Byte | +| Yottabyte | YB | 1024 Byte | 1 000 000 000 000 000 000 000 000 Byte | + +## Usage + +### Factories Each unit implements a Byte-based static factory method (`valueOf(BigInteger)` or `valueOf(long)`) that can be used to represent a given number of bytes in a specific unit. Note that `Long.MAX_VALUE == 8 Exabyte`, thus use `BigInteger` if you want to work with anything bigger than a eight Exabyte. When in doubt, always use `BigInteger`. -[source,java] ----- +```java // 'long' based -Kilobyte unit = Kilobyte.valueOf(500) // 500 Byte or "0.50 kB" -Kibibyte unit = Kibibyte.valueOf(512) // 512 Byte or "0.50 KiB" +Kilobyte unit = Kilobyte.valueOf(500) // 500 Byte or "0.50 kB" +Kibibyte unit = Kibibyte.valueOf(512) // 512 Byte or "0.50 KiB" -Megabyte unit = Megabyte.valueOf(1_000_000) // 1 000 000 Byte or "1.00 MB" -Mebibyte unit = Mebibyte.valueOf(1_048_576) // 1 048 576 Byte or "1.00 MiB" +Megabyte unit = Megabyte.valueOf(1_000_000) // 1 000 000 Byte or "1.00 MB" +Mebibyte unit = Mebibyte.valueOf(1_048_576) // 1 048 576 Byte or "1.00 MiB" // 'BigInteger' based -Kilobyte unit = Kilobyte.valueOf(BigInteger.valueOf(500)) // 500 Byte or "0.50 kB" -Kibibyte unit = Kibibyte.valueOf(BigInteger.valueOf(512)) // 512 Byte or "0.50 KiB" +Kilobyte unit = Kilobyte.valueOf(BigInteger.valueOf(500)) // 500 Byte or "0.50 kB" +Kibibyte unit = Kibibyte.valueOf(BigInteger.valueOf(512)) // 512 Byte or "0.50 KiB" Megabyte unit = Megabyte.valueOf(BigInteger.valueOf(1000000)) // 1 000 000 Byte or "1.00 MB" Mebibyte unit = Mebibyte.valueOf(BigInteger.valueOf(1_048_576)) // 1 048 576 Byte or "1.00 MB" ----- +``` The `StorageUnits` class offers three factory methods that automatically pick the best-matching unit for a given number of bytes. -==== Binary Units +#### Binary Units -[source,java] ----- +```java // 'long' based -StorageUnit unit = StorageUnits.binaryValueOf(256) // Kibibyte (0.25 KiB) -StorageUnit unit = StorageUnits.binaryValueOf(1048576) // Mebibyte (1.00 MiB) +StorageUnit unit = StorageUnits.binaryValueOf(256) // Kibibyte (0.25 KiB) +StorageUnit unit = StorageUnits.binaryValueOf(1048576) // Mebibyte (1.00 MiB) // 'BigInteger' based StorageUnit unit = StorageUnits.binaryValueOf(BigInteger.valueOf(256)) // Kibibyte (0.25 MiB) StorageUnit unit = StorageUnits.binaryValueOf(BigInteger.valueOf(1048576)) // Mebibyte (1.00 MiB) ----- +``` -==== Decimal Units +#### Decimal Units -[source,java] ----- +```java // 'long' based -StorageUnit unit = StorageUnits.decimalValueOf(120000) // Kilobyte (120.00 kB) -StorageUnit unit = StorageUnits.decimalValueOf(1000000) // Megabyte (1.00 MB) +StorageUnit unit = StorageUnits.decimalValueOf(120000) // Kilobyte (120.00 kB) +StorageUnit unit = StorageUnits.decimalValueOf(1000000) // Megabyte (1.00 MB) // 'BigInteger' based -StorageUnit unit = StorageUnits.decimalValueOf(BigInteger.valueOf(120000)) // Kilobyte (120.00 kB) -StorageUnit unit = StorageUnits.decimalValueOf(BigInteger.valueOf(1000000)) // Megabyte (1.00 MB) ----- +StorageUnit unit = StorageUnits.decimalValueOf(BigInteger.valueOf(120000)) // Kilobyte (120.00 kB) +StorageUnit unit = StorageUnits.decimalValueOf(BigInteger.valueOf(1000000)) // Megabyte (1.00 MB) +``` Additionally high-level factory methods are also available in the `StorageUnits` class. -[source,java] ----- -import static wtf.metio.storageunits.StorageUnits.*; +```java +import static wtf.metio.storageunits.model.StorageUnits.*; Kibibyte unit = kibibyte(1) // 1 024 Byte Mebibyte unit = mebibyte(1) // 1 048 576 Byte @@ -229,15 +114,14 @@ Petabyte unit = petabyte(1) // 1 000 000 000 000 000 Byte Exabyte unit = exabyte(1) // 1 000 000 000 000 000 000 Byte Zettabyte unit = zettabyte(1) // 1 000 000 000 000 000 000 000 Byte Yottabyte unit = yottabyte(1) // 1 000 000 000 000 000 000 000 000 Byte ----- +``` -=== Add, Subtract, Multiply, Divide +### Add, Subtract, Multiply, Divide Each unit implements the basic four math operations. All operations retain their original type, e.g. `[Kilobyte] + [Megabyte] = [Kilobyte]` -[source,java] ----- -import static wtf.metio.storageunits.StorageUnits.*; +```java +import static wtf.metio.storageunits.model.StorageUnits.*; kilobyte(4).add(kilobyte(8)) // 4 Kilobyte + 8 Kilobyte = 12 Kilobyte = 12 000 Byte kibibyte(1).add(1024) // 1 Kibibyte + 1 024 Byte = 2 Kibibyte = 2 048 Byte @@ -245,15 +129,14 @@ kibibyte(1).subtract(24) // 1 024 Byte - 24 Byte = 1 000 Byte megabyte(5).subtract(kilobyte(500)) // 5 Megabyte - 500 Kilobyte = 4.5 Megabyte = 4 500 Kilobyte = 4 500 000 Byte gigabyte(1).multiply(5) // 1 Gigabyte times 5 = 5 Gigabyte terabyte(1).divide(5) // 1 Terabyte divided by 5 = 0.2 Terabyte = 200 Gigabyte ----- +``` -=== Comparison & Equality +### Comparison & Equality Each unit is comparable to each other unit. -[source,java] ----- -import static wtf.metio.storageunits.StorageUnits.*; +```java +import static wtf.metio.storageunits.model.StorageUnits.*; kibibyte(1024).compareTo(mebibyte(1)) == 0 // true kibibyte(1000).compareTo(mebibyte(1)) == 0 // false @@ -262,15 +145,14 @@ petabyte(3).compareTo(terabyte(3000)) == 0 // true megabyte(1000).equals(gigabyte(1)) // true megabyte(1024).equals(gigabyte(1)) // false terabyte(12).equals(gigabyte(12000)) // true ----- +``` -=== Formatting +### Formatting Each unit prints a human-readable string, representing the amount of bytes in the given unit using the symbol specified in ISO IEC 80000-13:2008. -[source,java] ----- -import static wtf.metio.storageunits.StorageUnits.*; +```java +import static wtf.metio.storageunits.model.StorageUnits.*; // default pattern '0.00' terabyte(2).toString() // "2.00 TB" @@ -307,15 +189,14 @@ formatAsPebibyte(numberOfBytes, "#0.#####", Locale.GERMAN) // "0,88818 PiB" // use custom format formatAsTerabyte(numberOfBytes, customFormat) // "1000.00000 TB" formatAsPebibyte(numberOfBytes, customFormat) // ".88818 PiB" ----- +``` -=== Conversions +### Conversions Each unit can be converted to each other unit without loss of information. -[source,java] ----- -import static wtf.metio.storageunits.StorageUnits.*; +```java +import static wtf.metio.storageunits.model.StorageUnits.*; Megabyte unit = kilobyte(1000).asMegabyte() // "1.00 MB" Kilobyte unit = gigabyte(12).asKilobyte() // "12000000.00 kB" @@ -326,36 +207,34 @@ kilobyte(1100).asBestMatchingUnit() // "1.10 MB" kilobyte(1100).asBestMatchingBinaryUnit() // "1.05 MiB" kilobyte(1100).asBestMatchingDecimalUnit() // "1.10 MB" kilobyte(1100).asBestMatchingCommonUnit() // "1.05 MB" ----- +``` Each unit can be expressed as a fraction of another unit (precise up to 24 decimal places) -[source,java] ----- -import static wtf.metio.storageunits.StorageUnits.*; +```java +import static wtf.metio.storageunits.model.StorageUnits.*; BigDecimal kilobytes = megabyte(1).inKilobyte() // 1 000 BigInteger bytes = kibibyte(2).inByte() // 2 048 BigDecimal terabytes = gigabyte(15).inTerabyte() // 0.015 ----- +``` -=== Serialization +### Serialization -The storage-units-(eclipselink|mongodb|jackson) modules provide custom serializers to store storage units. +Multiple custom serializers are available to store storage units. -==== EclipseLink +#### EclipseLink Use any of the three converters like this: -[source, java] ----- +```java @Entity public class HardDisk implements Serializable { @Basic @Converter ( name="binaryConverter", - converterClass=de.xn__ho_hia.storage_unit.eclipselink.BinaryStorageUnitConverter.class + converterClass=wtf.metio.storageunits.eclipselink.BinaryStorageUnitConverter.class ) @Convert("binaryConverter") public StorageUnit getFreeSize() { @@ -364,18 +243,8 @@ public class HardDisk implements Serializable { @Basic @Converter ( - name="commonConverter", - converterClass=de.xn__ho_hia.storage_unit.eclipselink.CommonStorageUnitConverter.class - ) - @Convert("commonConverter") - public StorageUnit getUsedSize() { - return usedSize; - } - - @Basic - @Converter ( name="decimalConverter", - converterClass=de.xn__ho_hia.storage_unit.eclipselink.DecimalyStorageUnitConverter.class + converterClass=wtf.metio.storageunits.eclipselink.DecimalyStorageUnitConverter.class ) @Convert("decimalConverter") public StorageUnit getTotalSize() { @@ -383,48 +252,43 @@ public class HardDisk implements Serializable { } } ----- +``` -==== MongoDB +#### MongoDB Use any of the three codecs like this: -[source, java] ----- +```java CodecRegistry binaryRegistry = CodecRegistries.fromCodecs(new BinaryStorageUnitCodec(), ...); -CodecRegistry commonRegistry = CodecRegistries.fromCodecs(new CommonStorageUnitCodec(), ...); CodecRegistry decimalRegistry = CodecRegistries.fromCodecs(new DecimalStorageUnitCodec(), ...); ----- +``` -==== Jackson +#### Jackson Use the provided `StorageUnitModule` like this: -[source, java] ----- +```java ObjectMapper objectMapper = new ObjectMapper(); objectMapper.registerModule(new StorageUnitModule()); // defaults to binary units objectMapper.registerModule(new StorageUnitModule(StorageUnitModule.PreferredUnitType.BINARY)); -objectMapper.registerModule(new StorageUnitModule(StorageUnitModule.PreferredUnitType.COMMON)); objectMapper.registerModule(new StorageUnitModule(StorageUnitModule.PreferredUnitType.DECIMAL)); ----- +``` -=== Integration +### Integration To use this project just declare the following dependency inside your POM: -[source,xml,subs="attributes,verbatim"] ----- +```xml - {project-group} - storage-units + wtf.metio.storage-units + storage-units-model ${version.storage-units} - {project-group} + wtf.metio.storage-units storage-units-eclipselink ${version.storage-units} @@ -432,7 +296,7 @@ To use this project just declare the following dependency inside your POM: - {project-group} + wtf.metio.storage-units storage-units-mongodb ${version.storage-units} @@ -440,35 +304,36 @@ To use this project just declare the following dependency inside your POM: - {project-group} + wtf.metio.storage-units storage-units-jackson ${version.storage-units} ----- - -Replace `${version.storage-units}` with the link:++http://search.maven.org/#search%7Cga%7C1%7Cg%3Ade.xn--ho-hia.storage_units++[latest release]. - -== Reference +``` -Originally inspired by link:https://github.com/twitter/util#space[Twitters util] package. +Replace `${version.storage-units}` with the [latest release](https://search.maven.org/search?q=g:wtf.metio.storageunits). -== Alternatives +## Reference -* link:https://github.com/JakeWharton/byteunits[Byte Units] -* link:https://github.com/trivago/triava[triava] +Originally inspired by [Twitters util](https://github.com/twitter/util#space) package. -== License +## Alternatives -To the extent possible under law, the author(s) have dedicated all copyright -and related and neighboring rights to this software to the public domain -worldwide. This software is distributed without any warranty. +* [Byte Units](https://github.com/JakeWharton/byteunits) +* [triava](https://github.com/trivago/triava) -You should have received a copy of the CC0 Public Domain Dedication along -with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/. +## License -== Mirrors +``` +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. -* https://github.com/sebhoss/{project-name} -* http://repo.or.cz/{project-name}.git +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +``` diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..faeacbf --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,14 @@ + + +# Security Policy + +This project is using a continuous delivery mode and therefore only supports the latest released version. + +## Reporting a Vulnerability + +Email security@metio.wtf with details about the vulnerability. + +Please include some way to reproduce your problem. We are going to provide a fix as soon as possible and include it in the next release. diff --git a/java.properties b/java.properties new file mode 100644 index 0000000..82285ca --- /dev/null +++ b/java.properties @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: The Storage-Units Authors +# SPDX-License-Identifier: 0BSD + +javaVersion=17 diff --git a/maven-version-rules.xml b/maven-version-rules.xml dissimilarity index 72% index 1f99691..b1e3ee9 100644 --- a/maven-version-rules.xml +++ b/maven-version-rules.xml @@ -1,15 +1,15 @@ - - - - - - + + + + + (?i).*alpha.* + (?i).*beta.* + (?i).*-b.* + (?i).*-rc.* + + diff --git a/pom.xml b/pom.xml dissimilarity index 96% index 4736bd8..73d99e6 100755 --- a/pom.xml +++ b/pom.xml @@ -1,73 +1,106 @@ - - - 4.0.0 - - - - - - - wtf.metio.maven.parents - maven-parents-java-stable - 2022.9.30 - - - - - - - wtf.metio.storage-units - storage-units.java - ${revision} - pom - - - - - - Storage Units - Implementation of storage units according to ISO IEC 80000-13:2008. - https://storage-units.projects.metio.wtf/ - 2012 - - - - - - - storage-units-model - - - - - - - - - - - scm:git:git://github.com/metio/storage-units.java.git - scm:git:git@github.com:metio/storage-units.java.git - main - ${project.url} - - - - - - - - GitHub - https://github.com/metio/storage-units.java/issues - - - - - - - - 9999-99-99-SNAPSHOT - 17 - - - + + + + 4.0.0 + + + + + + + wtf.metio.maven.parents + maven-parents-java-stable + 2022.9.30 + + + + + + + wtf.metio.storage-units + storage-units.java + 9999.99.99-SNAPSHOT + pom + + + + + + Storage Units + Implementation of storage units according to ISO IEC 80000-13:2008. + https://storage-units.projects.metio.wtf/ + 2012 + + + + + + + storage-units-dozer + storage-units-eclipselink + storage-units-jackson + storage-units-jakarta + storage-units-mapstruct + storage-units-model + storage-units-modelmapper + storage-units-mongodb + storage-units-orika + + + + + + + + scm:git:git://github.com/metio/storage-units.java.git + scm:git:git@github.com:metio/storage-units.java.git + main + ${project.url} + + + + + + + + GitHub + https://github.com/metio/storage-units.java/issues + + + + + + + + ${javaVersion} + + + + + + org.codehaus.mojo + properties-maven-plugin + 1.1.0 + + + initialize + + read-project-properties + + + true + + java.properties + + + + + + + + + diff --git a/storage-units-dozer/pom.xml b/storage-units-dozer/pom.xml index e4fa458..82bd947 100644 --- a/storage-units-dozer/pom.xml +++ b/storage-units-dozer/pom.xml @@ -1,12 +1,8 @@ + ~ SPDX-FileCopyrightText: The Storage-Units Authors + ~ SPDX-License-Identifier: 0BSD + --> 4.0.0 @@ -17,7 +13,7 @@ wtf.metio.storage-units storage-units.java - ${revision} + 9999.99.99-SNAPSHOT @@ -49,4 +45,4 @@ 6.5.2 - \ No newline at end of file + diff --git a/storage-units-dozer/src/main/java/module-info.java b/storage-units-dozer/src/main/java/module-info.java index 34aa50c..b0fd726 100644 --- a/storage-units-dozer/src/main/java/module-info.java +++ b/storage-units-dozer/src/main/java/module-info.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ @org.jspecify.nullness.NullMarked module wtf.metio.storageunits.dozer { @@ -5,4 +9,4 @@ module wtf.metio.storageunits.dozer { requires org.jspecify; requires dozer.core; -} \ No newline at end of file +} diff --git a/storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/BinaryStorageUnitConverter.java b/storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/BinaryStorageUnitConverter.java index 1a19fcb..6ea3ace 100644 --- a/storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/BinaryStorageUnitConverter.java +++ b/storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/BinaryStorageUnitConverter.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.dozer; diff --git a/storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/DecimalStorageUnitConverter.java b/storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/DecimalStorageUnitConverter.java index 44e6016..8915cdb 100644 --- a/storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/DecimalStorageUnitConverter.java +++ b/storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/DecimalStorageUnitConverter.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.dozer; diff --git a/storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/package-info.java b/storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/package-info.java dissimilarity index 78% index be30beb..ea37418 100644 --- a/storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/package-info.java +++ b/storage-units-dozer/src/main/java/wtf/metio/storageunits/dozer/package-info.java @@ -1,10 +1,8 @@ -/* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. - */ -/** - * Serialization support for the Dozer Mapper API. - */ -package wtf.metio.storageunits.dozer; +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ +/** + * Serialization support for the Dozer Mapper API. + */ +package wtf.metio.storageunits.dozer; diff --git a/storage-units-eclipselink/pom.xml b/storage-units-eclipselink/pom.xml index ac25049..efdfda0 100644 --- a/storage-units-eclipselink/pom.xml +++ b/storage-units-eclipselink/pom.xml @@ -1,12 +1,8 @@ + ~ SPDX-FileCopyrightText: The Storage-Units Authors + ~ SPDX-License-Identifier: 0BSD + --> 4.0.0 @@ -17,7 +13,7 @@ wtf.metio.storage-units storage-units.java - ${revision} + 9999.99.99-SNAPSHOT @@ -54,4 +50,4 @@ test - \ No newline at end of file + diff --git a/storage-units-eclipselink/src/main/java/module-info.java b/storage-units-eclipselink/src/main/java/module-info.java index 72056a5..9628e54 100644 --- a/storage-units-eclipselink/src/main/java/module-info.java +++ b/storage-units-eclipselink/src/main/java/module-info.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ @org.jspecify.nullness.NullMarked module wtf.metio.storageunits.eclipselink { @@ -6,4 +10,4 @@ module wtf.metio.storageunits.eclipselink { requires java.sql; requires org.jspecify; -} \ No newline at end of file +} diff --git a/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/AbstractStorageUnitConverter.java b/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/AbstractStorageUnitConverter.java index 1b3efdc..6373f1a 100644 --- a/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/AbstractStorageUnitConverter.java +++ b/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/AbstractStorageUnitConverter.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.eclipselink; diff --git a/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/BinaryStorageUnitConverter.java b/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/BinaryStorageUnitConverter.java index 8ff4a2b..059bf6d 100644 --- a/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/BinaryStorageUnitConverter.java +++ b/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/BinaryStorageUnitConverter.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.eclipselink; diff --git a/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/DecimalStorageUnitConverter.java b/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/DecimalStorageUnitConverter.java index 518a996..f985826 100644 --- a/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/DecimalStorageUnitConverter.java +++ b/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/DecimalStorageUnitConverter.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.eclipselink; diff --git a/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/package-info.java b/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/package-info.java dissimilarity index 67% index 6b485e4..7f2e477 100644 --- a/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/package-info.java +++ b/storage-units-eclipselink/src/main/java/wtf/metio/storageunits/eclipselink/package-info.java @@ -1,12 +1,10 @@ -/* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. - */ -/** - * Serialization support for EclipseLink. - * - * @see EclipseLink Homepage - */ -package wtf.metio.storageunits.eclipselink; +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ +/** + * Serialization support for EclipseLink. + * + * @see EclipseLink Homepage + */ +package wtf.metio.storageunits.eclipselink; diff --git a/storage-units-eclipselink/src/test/java/wtf/metio/storageunits/eclipselink/StorageUnitConverterTest.java b/storage-units-eclipselink/src/test/java/wtf/metio/storageunits/eclipselink/StorageUnitConverterTest.java deleted file mode 100644 index 057ab6a..0000000 --- a/storage-units-eclipselink/src/test/java/wtf/metio/storageunits/eclipselink/StorageUnitConverterTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. - */ -package wtf.metio.storageunits.eclipselink; - -import java.math.BigInteger; -import java.util.stream.Stream; -import org.eclipse.persistence.internal.helper.DatabaseField; -import org.eclipse.persistence.mappings.DatabaseMapping; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.DynamicTest; -import org.junit.jupiter.api.TestFactory; -import org.mockito.BDDMockito; -import org.mockito.Mockito; -import wtf.metio.storageunits.model.StorageUnits; - -class StorageUnitConverterTest { - - private Stream converters() { - return Stream.of(new BinaryStorageUnitConverter(), new DecimalStorageUnitConverter()); - } - - @TestFactory - Stream shouldNotBeMutable() { - return converters() - .map(converter -> DynamicTest.dynamicTest("should not be mutable", - () -> Assertions.assertFalse(converter.isMutable()))); - } - - @TestFactory - Stream shouldConvertUnitToBigInteger() { - return converters() - .map(converter -> converter.convertObjectValueToDataValue(StorageUnits.kilobyte(1), null)) - .map(dataValue -> DynamicTest.dynamicTest("should convert storage unit to big integer", - () -> Assertions.assertEquals(BigInteger.valueOf(1000L), dataValue))); - } - - @TestFactory - Stream shouldConvertBigIntegerToUnit() { - return converters() - .map(converter -> converter.convertDataValueToObjectValue(BigInteger.valueOf(2000L), null)) - .map(objectValue -> DynamicTest.dynamicTest("should convert big integer to storage unit", - () -> Assertions.assertEquals(StorageUnits.kilobyte(2), objectValue))); - } - - @TestFactory - Stream shouldInitializeAsBigInt() { - return converters() - .map(converter -> DynamicTest.dynamicTest("should initialize as big integer", - () -> { - final var mapping = Mockito.mock(DatabaseMapping.class); - final var field = new DatabaseField(); - BDDMockito.given(mapping.getField()).willReturn(field); - - converter.initialize(mapping, null); - - Assertions.assertEquals(java.sql.Types.BIGINT, field.getSqlType()); - })); - } - -} diff --git a/storage-units-jackson/pom.xml b/storage-units-jackson/pom.xml index fe971c6..02266fa 100644 --- a/storage-units-jackson/pom.xml +++ b/storage-units-jackson/pom.xml @@ -1,12 +1,8 @@ + ~ SPDX-FileCopyrightText: The Storage-Units Authors + ~ SPDX-License-Identifier: 0BSD + --> 4.0.0 @@ -17,7 +13,7 @@ wtf.metio.storage-units storage-units.java - ${revision} + 9999.99.99-SNAPSHOT @@ -56,4 +52,4 @@ 0.3.0-alpha-1 - \ No newline at end of file + diff --git a/storage-units-jackson/src/main/java/module-info.java b/storage-units-jackson/src/main/java/module-info.java index 4ca711e..4e41ed9 100644 --- a/storage-units-jackson/src/main/java/module-info.java +++ b/storage-units-jackson/src/main/java/module-info.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ @org.jspecify.nullness.NullMarked module wtf.metio.storageunits.jackson { diff --git a/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/BinaryStorageUnitDeserializer.java b/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/BinaryStorageUnitDeserializer.java index 1e8f08c..11545ff 100644 --- a/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/BinaryStorageUnitDeserializer.java +++ b/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/BinaryStorageUnitDeserializer.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.jackson; diff --git a/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/DecimalStorageUnitDeserializer.java b/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/DecimalStorageUnitDeserializer.java index 03621a3..2445b82 100644 --- a/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/DecimalStorageUnitDeserializer.java +++ b/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/DecimalStorageUnitDeserializer.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.jackson; diff --git a/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/StorageUnitModule.java b/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/StorageUnitModule.java index 4c3cea8..191b1b4 100644 --- a/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/StorageUnitModule.java +++ b/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/StorageUnitModule.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.jackson; diff --git a/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/UnwrappingStorageUnitSerializer.java b/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/UnwrappingStorageUnitSerializer.java index 9257585..217336e 100644 --- a/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/UnwrappingStorageUnitSerializer.java +++ b/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/UnwrappingStorageUnitSerializer.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.jackson; diff --git a/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/package-info.java b/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/package-info.java dissimilarity index 68% index d6cbb6a..53a4d82 100644 --- a/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/package-info.java +++ b/storage-units-jackson/src/main/java/wtf/metio/storageunits/jackson/package-info.java @@ -1,12 +1,10 @@ -/* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. - */ -/** - * Serialization support for Jackson. - * - * @see Jackson Homepage - */ -package wtf.metio.storageunits.jackson; +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ +/** + * Serialization support for Jackson. + * + * @see Jackson Homepage + */ +package wtf.metio.storageunits.jackson; diff --git a/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonBinaryDeserializationTest.java b/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonBinaryDeserializationTest.java index ac788d2..9c0d7e2 100644 --- a/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonBinaryDeserializationTest.java +++ b/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonBinaryDeserializationTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.jackson; diff --git a/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonDecimalDeserializationTest.java b/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonDecimalDeserializationTest.java index 3709d8e..6f8177e 100644 --- a/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonDecimalDeserializationTest.java +++ b/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonDecimalDeserializationTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.jackson; diff --git a/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonDefaultDeserializationTest.java b/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonDefaultDeserializationTest.java index 73eff2a..2ab63af 100644 --- a/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonDefaultDeserializationTest.java +++ b/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonDefaultDeserializationTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.jackson; diff --git a/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonSerializationTest.java b/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonSerializationTest.java index a3efd9e..3e75b67 100644 --- a/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonSerializationTest.java +++ b/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/JacksonSerializationTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.jackson; diff --git a/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/PreferredUnitTypeTest.java b/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/PreferredUnitTypeTest.java index 0a31aa7..3e1a4bb 100644 --- a/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/PreferredUnitTypeTest.java +++ b/storage-units-jackson/src/test/java/wtf/metio/storageunits/jackson/PreferredUnitTypeTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.jackson; diff --git a/storage-units-jakarta/pom.xml b/storage-units-jakarta/pom.xml index ba3d8d4..aba0281 100644 --- a/storage-units-jakarta/pom.xml +++ b/storage-units-jakarta/pom.xml @@ -1,12 +1,8 @@ + ~ SPDX-FileCopyrightText: The Storage-Units Authors + ~ SPDX-License-Identifier: 0BSD + --> 4.0.0 @@ -17,7 +13,7 @@ wtf.metio.storage-units storage-units.java - ${revision} + 9999.99.99-SNAPSHOT @@ -49,4 +45,4 @@ 3.1.0 - \ No newline at end of file + diff --git a/storage-units-jakarta/src/main/java/module-info.java b/storage-units-jakarta/src/main/java/module-info.java index b1e755d..6eb9e8d 100644 --- a/storage-units-jakarta/src/main/java/module-info.java +++ b/storage-units-jakarta/src/main/java/module-info.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ @org.jspecify.nullness.NullMarked module wtf.metio.storageunits.jakarta { @@ -5,4 +9,4 @@ module wtf.metio.storageunits.jakarta { requires jakarta.persistence; requires org.jspecify; -} \ No newline at end of file +} diff --git a/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/AbstractStorageUnitConverter.java b/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/AbstractStorageUnitConverter.java index bedc29f..9365ec4 100644 --- a/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/AbstractStorageUnitConverter.java +++ b/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/AbstractStorageUnitConverter.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.jakarta; diff --git a/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/BinaryStorageUnitConverter.java b/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/BinaryStorageUnitConverter.java index ac98e6e..268efa9 100644 --- a/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/BinaryStorageUnitConverter.java +++ b/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/BinaryStorageUnitConverter.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.jakarta; diff --git a/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/DecimalStorageUnitConverter.java b/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/DecimalStorageUnitConverter.java index 15597a5..b96d5b5 100644 --- a/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/DecimalStorageUnitConverter.java +++ b/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/DecimalStorageUnitConverter.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.jakarta; diff --git a/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/package-info.java b/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/package-info.java dissimilarity index 63% index a4afa8e..62258dc 100644 --- a/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/package-info.java +++ b/storage-units-jakarta/src/main/java/wtf/metio/storageunits/jakarta/package-info.java @@ -1,12 +1,10 @@ -/* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. - */ -/** - * Serialization support for the Jakarta Persistence API. - * - * @see Jakarta Persistence Homepage - */ -package wtf.metio.storageunits.jakarta; +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ +/** + * Serialization support for the Jakarta Persistence API. + * + * @see Jakarta Persistence Homepage + */ +package wtf.metio.storageunits.jakarta; diff --git a/storage-units-jakarta/src/test/java/wtf/metio/storageunits/jakarta/StorageUnitConverterTest.java b/storage-units-jakarta/src/test/java/wtf/metio/storageunits/jakarta/StorageUnitConverterTest.java deleted file mode 100644 index 3717983..0000000 --- a/storage-units-jakarta/src/test/java/wtf/metio/storageunits/jakarta/StorageUnitConverterTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. - */ -package wtf.metio.storageunits.jakarta; - -import java.math.BigInteger; -import java.util.stream.Stream; -import org.eclipse.persistence.internal.helper.DatabaseField; -import org.eclipse.persistence.mappings.DatabaseMapping; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.DynamicTest; -import org.junit.jupiter.api.TestFactory; -import org.mockito.BDDMockito; -import org.mockito.Mockito; -import wtf.metio.storageunits.model.StorageUnits; - -class StorageUnitConverterTest { - - private Stream converters() { - return Stream.of(new BinaryStorageUnitConverter(), new DecimalStorageUnitConverter()); - } - - @TestFactory - Stream shouldNotBeMutable() { - return converters() - .map(converter -> DynamicTest.dynamicTest("should not be mutable", - () -> Assertions.assertFalse(converter.isMutable()))); - } - - @TestFactory - Stream shouldConvertUnitToBigInteger() { - return converters() - .map(converter -> converter.convertObjectValueToDataValue(StorageUnits.kilobyte(1), null)) - .map(dataValue -> DynamicTest.dynamicTest("should convert storage unit to big integer", - () -> Assertions.assertEquals(BigInteger.valueOf(1000L), dataValue))); - } - - @TestFactory - Stream shouldConvertBigIntegerToUnit() { - return converters() - .map(converter -> converter.convertDataValueToObjectValue(BigInteger.valueOf(2000L), null)) - .map(objectValue -> DynamicTest.dynamicTest("should convert big integer to storage unit", - () -> Assertions.assertEquals(StorageUnits.kilobyte(2), objectValue))); - } - - @TestFactory - Stream shouldInitializeAsBigInt() { - return converters() - .map(converter -> DynamicTest.dynamicTest("should initialize as big integer", - () -> { - final var mapping = Mockito.mock(DatabaseMapping.class); - final var field = new DatabaseField(); - BDDMockito.given(mapping.getField()).willReturn(field); - - converter.initialize(mapping, null); - - Assertions.assertEquals(java.sql.Types.BIGINT, field.getSqlType()); - })); - } - -} diff --git a/storage-units-mapstruct/pom.xml b/storage-units-mapstruct/pom.xml index 80341a7..cd461dc 100644 --- a/storage-units-mapstruct/pom.xml +++ b/storage-units-mapstruct/pom.xml @@ -1,12 +1,8 @@ + ~ SPDX-FileCopyrightText: The Storage-Units Authors + ~ SPDX-License-Identifier: 0BSD + --> 4.0.0 @@ -17,7 +13,7 @@ wtf.metio.storage-units storage-units.java - ${revision} + 9999.99.99-SNAPSHOT @@ -44,4 +40,4 @@ 0.3.0-alpha-1 - \ No newline at end of file + diff --git a/storage-units-mapstruct/src/main/java/module-info.java b/storage-units-mapstruct/src/main/java/module-info.java index e403e94..e9c3889 100644 --- a/storage-units-mapstruct/src/main/java/module-info.java +++ b/storage-units-mapstruct/src/main/java/module-info.java @@ -1,7 +1,11 @@ +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ @org.jspecify.nullness.NullMarked module wtf.metio.storageunits.mapstruct { requires wtf.metio.storageunits.model; requires org.jspecify; -} \ No newline at end of file +} diff --git a/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/BigIntegerToBinaryUnitMapper.java b/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/BigIntegerToBinaryUnitMapper.java index 95e66eb..90cf84e 100644 --- a/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/BigIntegerToBinaryUnitMapper.java +++ b/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/BigIntegerToBinaryUnitMapper.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.mapstruct; diff --git a/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/BigIntegerToDecimalUnitMapper.java b/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/BigIntegerToDecimalUnitMapper.java index 7b8f4d5..9ab5728 100644 --- a/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/BigIntegerToDecimalUnitMapper.java +++ b/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/BigIntegerToDecimalUnitMapper.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.mapstruct; diff --git a/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/LongToBinaryUnitMapper.java b/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/LongToBinaryUnitMapper.java index 5a4b66b..6187269 100644 --- a/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/LongToBinaryUnitMapper.java +++ b/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/LongToBinaryUnitMapper.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.mapstruct; diff --git a/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/LongToDecimalUnitMapper.java b/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/LongToDecimalUnitMapper.java index 5598483..32b83f7 100644 --- a/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/LongToDecimalUnitMapper.java +++ b/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/LongToDecimalUnitMapper.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.mapstruct; diff --git a/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/StorageUnitToBigIntegerMapper.java b/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/StorageUnitToBigIntegerMapper.java index a47e7eb..e63aec3 100644 --- a/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/StorageUnitToBigIntegerMapper.java +++ b/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/StorageUnitToBigIntegerMapper.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.mapstruct; diff --git a/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/package-info.java b/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/package-info.java dissimilarity index 79% index 8ab3bd7..1ddf35e 100644 --- a/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/package-info.java +++ b/storage-units-mapstruct/src/main/java/wtf/metio/storageunits/mapstruct/package-info.java @@ -1,10 +1,8 @@ -/* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. - */ -/** - * Serialization support for MapStruct. - */ -package wtf.metio.storageunits.mapstruct; +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ +/** + * Serialization support for MapStruct. + */ +package wtf.metio.storageunits.mapstruct; diff --git a/storage-units-model/pom.xml b/storage-units-model/pom.xml index 3b9321c..11e8fb6 100644 --- a/storage-units-model/pom.xml +++ b/storage-units-model/pom.xml @@ -1,4 +1,8 @@ + 4.0.0 @@ -9,7 +13,7 @@ wtf.metio.storage-units storage-units.java - ${revision} + 9999.99.99-SNAPSHOT @@ -46,4 +50,4 @@ 4.7.3 - \ No newline at end of file + diff --git a/storage-units-model/src/main/java/module-info.java b/storage-units-model/src/main/java/module-info.java index 9a51094..fd73fa7 100644 --- a/storage-units-model/src/main/java/module-info.java +++ b/storage-units-model/src/main/java/module-info.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ @org.jspecify.nullness.NullMarked module wtf.metio.storageunits.model { diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Byte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Byte.java index 1ac9e0a..afd9227 100644 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Byte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Byte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Exabyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Exabyte.java index 59e6b30..7cd7b6f 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Exabyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Exabyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Exbibyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Exbibyte.java index 8da309d..c260171 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Exbibyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Exbibyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/FormatUtils.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/FormatUtils.java index 67289a9..fe87f39 100644 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/FormatUtils.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/FormatUtils.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Gibibyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Gibibyte.java index 2ad2f0c..5243555 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Gibibyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Gibibyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Gigabyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Gigabyte.java index 86f74e8..ee3fe92 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Gigabyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Gigabyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Kibibyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Kibibyte.java index c9781a5..79a3dfd 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Kibibyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Kibibyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Kilobyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Kilobyte.java index 9389398..b690783 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Kilobyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Kilobyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Mebibyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Mebibyte.java index 40d7851..9dcb7bd 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Mebibyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Mebibyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Megabyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Megabyte.java index 4a2fe65..0a4dbaf 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Megabyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Megabyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Pebibyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Pebibyte.java index a3ba166..2d26937 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Pebibyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Pebibyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Petabyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Petabyte.java index 8a15957..f8b1d6d 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Petabyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Petabyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/StorageUnit.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/StorageUnit.java index d93ed84..96256c3 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/StorageUnit.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/StorageUnit.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; @@ -580,8 +578,8 @@ public abstract class StorageUnit> extends Number imple @NotNull @CheckReturnValue private BigDecimal calculate(final BigInteger base) { - return new BigDecimal(this.bytes.toString()) - .divide(new BigDecimal(base.toString()), StorageUnit.DEFAULT_SCALE, RoundingMode.CEILING); + return new BigDecimal(this.bytes) + .divide(new BigDecimal(base), StorageUnit.DEFAULT_SCALE, RoundingMode.CEILING); } @Override diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/StorageUnits.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/StorageUnits.java index 501cda9..b018d95 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/StorageUnits.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/StorageUnits.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Tebibyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Tebibyte.java index 2184d93..aec906b 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Tebibyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Tebibyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Terabyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Terabyte.java index c63cf78..9db53b4 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Terabyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Terabyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Yobibyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Yobibyte.java index 0d2042b..f4e8959 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Yobibyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Yobibyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Yottabyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Yottabyte.java index db4260f..2844ec4 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Yottabyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Yottabyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Zebibyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Zebibyte.java index f36aa85..fd4dee7 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Zebibyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Zebibyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Zettabyte.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Zettabyte.java index 7bd8030..a79dc61 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/Zettabyte.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/Zettabyte.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/main/java/wtf/metio/storageunits/model/package-info.java b/storage-units-model/src/main/java/wtf/metio/storageunits/model/package-info.java index 5bdd7b4..4e01b80 100755 --- a/storage-units-model/src/main/java/wtf/metio/storageunits/model/package-info.java +++ b/storage-units-model/src/main/java/wtf/metio/storageunits/model/package-info.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ /** * Storage units according to ISO IEC 80000-13:2008. diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/FormatUtilsTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/FormatUtilsTest.java index bcf66ad..afee377 100644 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/FormatUtilsTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/FormatUtilsTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/ReadmeConversionsTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/ReadmeConversionsTest.java index 722e08a..4221811 100644 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/ReadmeConversionsTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/ReadmeConversionsTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/ReadmeFormattingTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/ReadmeFormattingTest.java index 877927c..62d68d9 100644 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/ReadmeFormattingTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/ReadmeFormattingTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitArithmeticBigIntegerTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitArithmeticBigIntegerTest.java index 3119b06..4afefdc 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitArithmeticBigIntegerTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitArithmeticBigIntegerTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitArithmeticLongTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitArithmeticLongTest.java index 06fd949..455ef79 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitArithmeticLongTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitArithmeticLongTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitCompareToTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitCompareToTest.java index 2c38e26..cacaa58 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitCompareToTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitCompareToTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitConversionTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitConversionTest.java index 0d20277..41a89e9 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitConversionTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitConversionTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitExpressionTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitExpressionTest.java index 94128d7..09877cf 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitExpressionTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitExpressionTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitFormattingTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitFormattingTest.java index b341344..96a2f9b 100644 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitFormattingTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitFormattingTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitNumberOfBytesPerUnitTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitNumberOfBytesPerUnitTest.java index 64ae28f..2f8503d 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitNumberOfBytesPerUnitTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitNumberOfBytesPerUnitTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitNumberTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitNumberTest.java index fb2add6..674ce32 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitNumberTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitNumberTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitTest.java index 3bf4bd1..1d84ae8 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitToStringTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitToStringTest.java index 29e7ecb..6447c35 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitToStringTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitToStringTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsBigBinaryTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsBigBinaryTest.java index 84eef28..7abd02a 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsBigBinaryTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsBigBinaryTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsBigDecimalTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsBigDecimalTest.java index 766bebc..85993bc 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsBigDecimalTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsBigDecimalTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingTest.java index c5d21f0..3ef2cb6 100644 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithAnyFormatTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithAnyFormatTest.java index 1e11653..308ca20 100644 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithAnyFormatTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithAnyFormatTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithDefaultsTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithDefaultsTest.java index a3b9d9d..b1e983c 100644 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithDefaultsTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithDefaultsTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithPatternAndLocaleTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithPatternAndLocaleTest.java index eb72fdf..0e33adc 100644 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithPatternAndLocaleTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithPatternAndLocaleTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithPatternTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithPatternTest.java index 030e5cc..8f8db31 100644 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithPatternTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsFormattingWithPatternTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsTest.java index a3aa34a..a78bd83 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsWithBigIntegerTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsWithBigIntegerTest.java index 94343eb..76de485 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsWithBigIntegerTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsWithBigIntegerTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsWithLongTest.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsWithLongTest.java index d2f095e..2336059 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsWithLongTest.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/StorageUnitsWithLongTest.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/TestObjects.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/TestObjects.java index 3abb309..284767b 100755 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/TestObjects.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/TestObjects.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-model/src/test/java/wtf/metio/storageunits/model/TestUtils.java b/storage-units-model/src/test/java/wtf/metio/storageunits/model/TestUtils.java index 782d24a..aec65c0 100644 --- a/storage-units-model/src/test/java/wtf/metio/storageunits/model/TestUtils.java +++ b/storage-units-model/src/test/java/wtf/metio/storageunits/model/TestUtils.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.model; diff --git a/storage-units-modelmapper/pom.xml b/storage-units-modelmapper/pom.xml index 21826d5..8bc14a0 100644 --- a/storage-units-modelmapper/pom.xml +++ b/storage-units-modelmapper/pom.xml @@ -1,12 +1,8 @@ + ~ SPDX-FileCopyrightText: The Storage-Units Authors + ~ SPDX-License-Identifier: 0BSD + --> 4.0.0 @@ -17,7 +13,7 @@ wtf.metio.storage-units storage-units.java - ${revision} + 9999.99.99-SNAPSHOT @@ -49,4 +45,4 @@ 3.0.0 - \ No newline at end of file + diff --git a/storage-units-modelmapper/src/main/java/module-info.java b/storage-units-modelmapper/src/main/java/module-info.java index 13f9a33..8852fa1 100644 --- a/storage-units-modelmapper/src/main/java/module-info.java +++ b/storage-units-modelmapper/src/main/java/module-info.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ @org.jspecify.nullness.NullMarked module wtf.metio.storageunits.modelmapper { @@ -5,4 +9,4 @@ module wtf.metio.storageunits.modelmapper { requires modelmapper; requires org.jspecify; -} \ No newline at end of file +} diff --git a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/package-info.java b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/package-info.java deleted file mode 100644 index b02ae7a..0000000 --- a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. - */ -/** - * Serialization support for ModelMapper. - */ -package wtf.metio.storageunits.jakarta; diff --git a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/BigIntegerToBinaryUnitConverter.java b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/BigIntegerToBinaryUnitConverter.java similarity index 53% rename from storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/BigIntegerToBinaryUnitConverter.java rename to storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/BigIntegerToBinaryUnitConverter.java index bb2973d..58898ca 100644 --- a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/BigIntegerToBinaryUnitConverter.java +++ b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/BigIntegerToBinaryUnitConverter.java @@ -1,10 +1,8 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ -package wtf.metio.storageunits.jakarta; +package wtf.metio.storageunits.modelmapper; import java.math.BigInteger; import org.modelmapper.AbstractConverter; diff --git a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/BigIntegerToDecimalUnitConverter.java b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/BigIntegerToDecimalUnitConverter.java similarity index 53% rename from storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/BigIntegerToDecimalUnitConverter.java rename to storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/BigIntegerToDecimalUnitConverter.java index c96a2c8..5e3fa50 100644 --- a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/BigIntegerToDecimalUnitConverter.java +++ b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/BigIntegerToDecimalUnitConverter.java @@ -1,10 +1,8 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ -package wtf.metio.storageunits.jakarta; +package wtf.metio.storageunits.modelmapper; import java.math.BigInteger; import org.modelmapper.AbstractConverter; diff --git a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/LongToBinaryUnitConverter.java b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/LongToBinaryUnitConverter.java similarity index 50% rename from storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/LongToBinaryUnitConverter.java rename to storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/LongToBinaryUnitConverter.java index edd94dd..398d86d 100644 --- a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/LongToBinaryUnitConverter.java +++ b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/LongToBinaryUnitConverter.java @@ -1,10 +1,8 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ -package wtf.metio.storageunits.jakarta; +package wtf.metio.storageunits.modelmapper; import org.modelmapper.AbstractConverter; import wtf.metio.storageunits.model.StorageUnit; diff --git a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/LongToDecimalUnitConverter.java b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/LongToDecimalUnitConverter.java similarity index 51% rename from storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/LongToDecimalUnitConverter.java rename to storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/LongToDecimalUnitConverter.java index 1512f28..38c66cb 100644 --- a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/LongToDecimalUnitConverter.java +++ b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/LongToDecimalUnitConverter.java @@ -1,10 +1,8 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ -package wtf.metio.storageunits.jakarta; +package wtf.metio.storageunits.modelmapper; import org.modelmapper.AbstractConverter; import wtf.metio.storageunits.model.StorageUnit; diff --git a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/StorageUnitToBigIntegerConverter.java b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/StorageUnitToBigIntegerConverter.java similarity index 50% rename from storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/StorageUnitToBigIntegerConverter.java rename to storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/StorageUnitToBigIntegerConverter.java index a6c4493..ff2b67d 100644 --- a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/jakarta/StorageUnitToBigIntegerConverter.java +++ b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/StorageUnitToBigIntegerConverter.java @@ -1,10 +1,8 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ -package wtf.metio.storageunits.jakarta; +package wtf.metio.storageunits.modelmapper; import java.math.BigInteger; import org.modelmapper.AbstractConverter; diff --git a/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/package-info.java b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/package-info.java new file mode 100644 index 0000000..ab3e49b --- /dev/null +++ b/storage-units-modelmapper/src/main/java/wtf/metio/storageunits/modelmapper/package-info.java @@ -0,0 +1,8 @@ +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ +/** + * Serialization support for ModelMapper. + */ +package wtf.metio.storageunits.modelmapper; diff --git a/storage-units-modelmapper/src/test/java/wtf/metio/storageunits/jakarta/StorageUnitConverterTest.java b/storage-units-modelmapper/src/test/java/wtf/metio/storageunits/jakarta/StorageUnitConverterTest.java deleted file mode 100644 index 38a4e9d..0000000 --- a/storage-units-modelmapper/src/test/java/wtf/metio/storageunits/jakarta/StorageUnitConverterTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. - */ -package wtf.metio.storageunits.jakarta; - -import java.math.BigInteger; -import java.util.stream.Stream; -import org.eclipse.persistence.internal.helper.DatabaseField; -import org.eclipse.persistence.mappings.DatabaseMapping; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.DynamicTest; -import org.junit.jupiter.api.TestFactory; -import org.mockito.BDDMockito; -import org.mockito.Mockito; -import wtf.metio.storageunits.model.StorageUnits; - -class StorageUnitConverterTest { - - private Stream converters() { - return Stream.of(new BigIntegerToBinaryUnitConverter(), new DecimalStorageUnitConverter()); - } - - @TestFactory - Stream shouldNotBeMutable() { - return converters() - .map(converter -> DynamicTest.dynamicTest("should not be mutable", - () -> Assertions.assertFalse(converter.isMutable()))); - } - - @TestFactory - Stream shouldConvertUnitToBigInteger() { - return converters() - .map(converter -> converter.convertObjectValueToDataValue(StorageUnits.kilobyte(1), null)) - .map(dataValue -> DynamicTest.dynamicTest("should convert storage unit to big integer", - () -> Assertions.assertEquals(BigInteger.valueOf(1000L), dataValue))); - } - - @TestFactory - Stream shouldConvertBigIntegerToUnit() { - return converters() - .map(converter -> converter.convertDataValueToObjectValue(BigInteger.valueOf(2000L), null)) - .map(objectValue -> DynamicTest.dynamicTest("should convert big integer to storage unit", - () -> Assertions.assertEquals(StorageUnits.kilobyte(2), objectValue))); - } - - @TestFactory - Stream shouldInitializeAsBigInt() { - return converters() - .map(converter -> DynamicTest.dynamicTest("should initialize as big integer", - () -> { - final var mapping = Mockito.mock(DatabaseMapping.class); - final var field = new DatabaseField(); - BDDMockito.given(mapping.getField()).willReturn(field); - - converter.initialize(mapping, null); - - Assertions.assertEquals(java.sql.Types.BIGINT, field.getSqlType()); - })); - } - -} diff --git a/storage-units-mongodb/pom.xml b/storage-units-mongodb/pom.xml index ad6d8cf..5cbb947 100644 --- a/storage-units-mongodb/pom.xml +++ b/storage-units-mongodb/pom.xml @@ -1,12 +1,8 @@ + ~ SPDX-FileCopyrightText: The Storage-Units Authors + ~ SPDX-License-Identifier: 0BSD + --> 4.0.0 @@ -17,7 +13,7 @@ wtf.metio.storage-units storage-units.java - ${revision} + 9999.99.99-SNAPSHOT @@ -54,4 +50,4 @@ test - \ No newline at end of file + diff --git a/storage-units-mongodb/src/main/java/module-info.java b/storage-units-mongodb/src/main/java/module-info.java index 5524527..1210bd7 100644 --- a/storage-units-mongodb/src/main/java/module-info.java +++ b/storage-units-mongodb/src/main/java/module-info.java @@ -1,3 +1,7 @@ +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ @org.jspecify.nullness.NullMarked module wtf.metio.storageunits.mongodb { @@ -5,4 +9,4 @@ module wtf.metio.storageunits.mongodb { requires org.mongodb.bson; requires org.jspecify; -} \ No newline at end of file +} diff --git a/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/AbstractStorageUnitCodec.java b/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/AbstractStorageUnitCodec.java index 5f9ad73..8e4f085 100644 --- a/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/AbstractStorageUnitCodec.java +++ b/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/AbstractStorageUnitCodec.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.mongodb; diff --git a/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/BinaryStorageUnitCodec.java b/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/BinaryStorageUnitCodec.java index 1837503..ea837ec 100644 --- a/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/BinaryStorageUnitCodec.java +++ b/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/BinaryStorageUnitCodec.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.mongodb; diff --git a/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/DecimalStorageUnitCodec.java b/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/DecimalStorageUnitCodec.java index 6a6e403..63ef3fd 100644 --- a/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/DecimalStorageUnitCodec.java +++ b/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/DecimalStorageUnitCodec.java @@ -1,8 +1,6 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.mongodb; diff --git a/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/package-info.java b/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/package-info.java dissimilarity index 70% index 4c34b62..c57c746 100644 --- a/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/package-info.java +++ b/storage-units-mongodb/src/main/java/wtf/metio/storageunits/mongodb/package-info.java @@ -1,12 +1,10 @@ -/* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. - */ -/** - * Serialization support for MongoDB. - * - * @see MongoDB Homepage - */ -package wtf.metio.storageunits.mongodb; +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ +/** + * Serialization support for MongoDB. + * + * @see MongoDB Homepage + */ +package wtf.metio.storageunits.mongodb; diff --git a/storage-units-mongodb/src/test/java/wtf/metio/storageunits/mongodb/StorageUnitCodecTest.java b/storage-units-mongodb/src/test/java/wtf/metio/storageunits/mongodb/StorageUnitCodecTest.java index 3def3dc..3b3f7d3 100644 --- a/storage-units-mongodb/src/test/java/wtf/metio/storageunits/mongodb/StorageUnitCodecTest.java +++ b/storage-units-mongodb/src/test/java/wtf/metio/storageunits/mongodb/StorageUnitCodecTest.java @@ -1,4 +1,9 @@ /* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ + +/* * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, * including this file, may be copied, modified, propagated, or distributed except according to the terms contained diff --git a/storage-units-orika/pom.xml b/storage-units-orika/pom.xml index 66b1cb2..40d74fb 100644 --- a/storage-units-orika/pom.xml +++ b/storage-units-orika/pom.xml @@ -1,12 +1,8 @@ + ~ SPDX-FileCopyrightText: The Storage-Units Authors + ~ SPDX-License-Identifier: 0BSD + --> 4.0.0 @@ -17,7 +13,7 @@ wtf.metio.storage-units storage-units.java - ${revision} + 9999.99.99-SNAPSHOT @@ -46,7 +42,7 @@ ma.glasnost.orika orika-core - 1.4.2 + 1.5.4 - \ No newline at end of file + diff --git a/storage-units-orika/src/main/java/module-info.java b/storage-units-orika/src/main/java/module-info.java index ed9d25c..800a499 100644 --- a/storage-units-orika/src/main/java/module-info.java +++ b/storage-units-orika/src/main/java/module-info.java @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ + @org.jspecify.nullness.NullMarked module wtf.metio.storageunits.orika { @@ -5,4 +10,4 @@ module wtf.metio.storageunits.orika { requires orika.core; requires org.jspecify; -} \ No newline at end of file +} diff --git a/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/AbstractStorageUnitConverter.java b/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/AbstractStorageUnitConverter.java index 465863f..70c989e 100644 --- a/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/AbstractStorageUnitConverter.java +++ b/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/AbstractStorageUnitConverter.java @@ -1,12 +1,12 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.orika; import java.math.BigInteger; + +import ma.glasnost.orika.MappingContext; import ma.glasnost.orika.converter.BidirectionalConverter; import ma.glasnost.orika.metadata.Type; import wtf.metio.storageunits.model.StorageUnit; @@ -17,7 +17,7 @@ import wtf.metio.storageunits.model.StorageUnit; abstract class AbstractStorageUnitConverter extends BidirectionalConverter, BigInteger> { @Override - public final BigInteger convertTo(final StorageUnit storageUnit, Type destinationType) { + public final BigInteger convertTo(final StorageUnit storageUnit, final Type destinationType, final MappingContext mappingContext) { return storageUnit.inByte(); } diff --git a/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/BinaryStorageUnitConverter.java b/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/BinaryStorageUnitConverter.java index 06d999e..878dcac 100644 --- a/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/BinaryStorageUnitConverter.java +++ b/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/BinaryStorageUnitConverter.java @@ -1,12 +1,12 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.orika; import java.math.BigInteger; + +import ma.glasnost.orika.MappingContext; import ma.glasnost.orika.metadata.Type; import wtf.metio.storageunits.model.StorageUnit; import wtf.metio.storageunits.model.StorageUnits; @@ -17,7 +17,7 @@ import wtf.metio.storageunits.model.StorageUnits; public final class BinaryStorageUnitConverter extends AbstractStorageUnitConverter { @Override - public StorageUnit convertFrom(final BigInteger value, Type> destinationType) { + public StorageUnit convertFrom(final BigInteger value, final Type> destinationType, final MappingContext mappingContext) { return StorageUnits.binaryValueOf(value); } diff --git a/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/DecimalStorageUnitConverter.java b/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/DecimalStorageUnitConverter.java index 5f30447..5c74e5b 100644 --- a/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/DecimalStorageUnitConverter.java +++ b/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/DecimalStorageUnitConverter.java @@ -1,12 +1,12 @@ /* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD */ package wtf.metio.storageunits.orika; import java.math.BigInteger; + +import ma.glasnost.orika.MappingContext; import ma.glasnost.orika.metadata.Type; import wtf.metio.storageunits.model.StorageUnit; import wtf.metio.storageunits.model.StorageUnits; @@ -17,7 +17,7 @@ import wtf.metio.storageunits.model.StorageUnits; public final class DecimalStorageUnitConverter extends AbstractStorageUnitConverter { @Override - public StorageUnit convertFrom(final BigInteger value, Type> destinationType) { + public StorageUnit convertFrom(final BigInteger value, final Type> destinationType, final MappingContext mappingContext) { return StorageUnits.decimalValueOf(value); } diff --git a/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/package-info.java b/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/package-info.java dissimilarity index 80% index 64e8ee9..4d17ef1 100644 --- a/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/package-info.java +++ b/storage-units-orika/src/main/java/wtf/metio/storageunits/orika/package-info.java @@ -1,10 +1,8 @@ -/* - * This file is part of storage-units. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of storage-units, - * including this file, may be copied, modified, propagated, or distributed except according to the terms contained - * in the LICENSE file. - */ -/** - * Serialization support for Orika. - */ -package wtf.metio.storageunits.orika; +/* + * SPDX-FileCopyrightText: The Storage-Units Authors + * SPDX-License-Identifier: 0BSD + */ +/** + * Serialization support for Orika. + */ +package wtf.metio.storageunits.orika; -- 2.11.4.GIT