From 31a6d704e50c823e136caddc7cb56c3025796ebd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Ho=C3=9F?= Date: Sat, 29 Oct 2022 13:35:19 +0200 Subject: [PATCH] sort modifiers --- .../java/wtf/metio/storageunits/model/Byte.java | 46 +- .../java/wtf/metio/storageunits/model/Exabyte.java | 50 +- .../wtf/metio/storageunits/model/Exbibyte.java | 50 +- .../wtf/metio/storageunits/model/FormatUtils.java | 3 +- .../wtf/metio/storageunits/model/Gibibyte.java | 50 +- .../wtf/metio/storageunits/model/Gigabyte.java | 50 +- .../wtf/metio/storageunits/model/Kibibyte.java | 50 +- .../wtf/metio/storageunits/model/Kilobyte.java | 50 +- .../wtf/metio/storageunits/model/Mebibyte.java | 50 +- .../wtf/metio/storageunits/model/Megabyte.java | 50 +- .../wtf/metio/storageunits/model/Pebibyte.java | 50 +- .../wtf/metio/storageunits/model/Petabyte.java | 50 +- .../wtf/metio/storageunits/model/StorageUnit.java | 251 ++--- .../wtf/metio/storageunits/model/StorageUnits.java | 1114 ++++++++------------ .../wtf/metio/storageunits/model/Tebibyte.java | 50 +- .../wtf/metio/storageunits/model/Terabyte.java | 50 +- .../wtf/metio/storageunits/model/Yobibyte.java | 50 +- .../wtf/metio/storageunits/model/Yottabyte.java | 50 +- .../wtf/metio/storageunits/model/Zebibyte.java | 50 +- .../wtf/metio/storageunits/model/Zettabyte.java | 50 +- 20 files changed, 794 insertions(+), 1420 deletions(-) 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 78b5f6c..f0a0665 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 @@ -19,7 +19,7 @@ public final class Byte extends StorageUnit { @Serial private static final long serialVersionUID = 6952239416014811456L; - Byte(@NotNull final BigInteger numberOfBytes) { + Byte(final @NotNull BigInteger numberOfBytes) { super(numberOfBytes); } @@ -27,9 +27,8 @@ public final class Byte extends StorageUnit { * @param numberOfBytes The amount of bytes the Byte contains. * @return A new Byte unit with the given value. */ - @NotNull @CheckReturnValue - public static Byte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Byte valueOf(final @NotNull BigInteger numberOfBytes) { return new Byte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Byte extends StorageUnit { * @param numberOfBytes The amount of bytes the Byte contains. * @return A new Byte unit with the given value. */ - @NotNull @CheckReturnValue - public static Byte valueOf(final long numberOfBytes) { + public static @NotNull Byte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,91 +45,81 @@ public final class Byte extends StorageUnit { * @param numberOfBytes The amount of bytes the Byte contains. * @return A new Byte unit with the given value. */ - @NotNull @CheckReturnValue - public static Byte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Byte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Byte add(final long bytesToAdd) { + public @NotNull Byte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - public @NotNull Byte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Byte add(final @NotNull BigInteger bytesToAdd) { return new Byte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Byte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Byte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Byte divide(final long divisor) { + public @NotNull Byte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - public @NotNull Byte divide(@NotNull final BigInteger divisor) { + public @NotNull Byte divide(final @NotNull BigInteger divisor) { return new Byte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Byte multiply(final long factor) { + public @NotNull Byte multiply(final long factor) { return new Byte(bytes.multiply(BigInteger.valueOf(factor))); } @Override - public @NotNull Byte multiply(@NotNull final BigInteger factor) { + public @NotNull Byte multiply(final @NotNull BigInteger factor) { return new Byte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Byte subtract(final long bytesToSubtract) { + public @NotNull Byte subtract(final long bytesToSubtract) { return new Byte(bytes.subtract(BigInteger.valueOf(bytesToSubtract))); } @Override - public @NotNull Byte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Byte subtract(final @NotNull BigInteger bytesToSubtract) { return new Byte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Byte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Byte subtract(final @NotNull StorageUnit storageAmount) { return new Byte(bytes.subtract(storageAmount.bytes)); } @Override - @NotNull - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return BigInteger.ONE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "B"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::binaryValueOf; } 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 6a06d35..4398147 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 @@ -19,7 +19,7 @@ public final class Exabyte extends StorageUnit { @Serial private static final long serialVersionUID = 6846441733771841250L; - Exabyte(@NotNull final BigInteger bytes) { + Exabyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Exabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Exabyte contains. * @return A new Exabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Exabyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Exabyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Exabyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Exabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Exabyte contains. * @return A new Exabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Exabyte valueOf(final long numberOfBytes) { + public static @NotNull Exabyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Exabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Exabyte contains. * @return A new Exabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Exabyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Exabyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Exabyte add(final long bytesToAdd) { + public @NotNull Exabyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Exabyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Exabyte add(final @NotNull BigInteger bytesToAdd) { return new Exabyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Exabyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Exabyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Exabyte divide(final long divisor) { + public @NotNull Exabyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Exabyte divide(@NotNull final BigInteger divisor) { + public @NotNull Exabyte divide(final @NotNull BigInteger divisor) { return new Exabyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Exabyte multiply(final long factor) { + public @NotNull Exabyte multiply(final long factor) { return new Exabyte(bytes.multiply(BigInteger.valueOf(factor))); } @Override - @NotNull @CheckReturnValue - public Exabyte multiply(@NotNull final BigInteger factor) { + public @NotNull Exabyte multiply(final @NotNull BigInteger factor) { return new Exabyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Exabyte subtract(final long bytesToSubtract) { + public @NotNull Exabyte subtract(final long bytesToSubtract) { return new Exabyte(bytes.subtract(BigInteger.valueOf(bytesToSubtract))); } @Override - @NotNull @CheckReturnValue - public Exabyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Exabyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Exabyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Exabyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Exabyte subtract(final @NotNull StorageUnit storageAmount) { return new Exabyte(bytes.subtract(storageAmount.bytes)); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return StorageUnit.BYTES_IN_A_EXABYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "EB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::decimalValueOf; } 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 f6e456a..1b55550 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 @@ -19,7 +19,7 @@ public final class Exbibyte extends StorageUnit { @Serial private static final long serialVersionUID = 5993490571003918471L; - Exbibyte(@NotNull final BigInteger bytes) { + Exbibyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Exbibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Exbibyte contains. * @return A new Exbibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Exbibyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Exbibyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Exbibyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Exbibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Exbibyte contains. * @return A new Exbibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Exbibyte valueOf(final long numberOfBytes) { + public static @NotNull Exbibyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Exbibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Exbibyte contains. * @return A new Exbibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Exbibyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Exbibyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Exbibyte add(final long bytesToAdd) { + public @NotNull Exbibyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Exbibyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Exbibyte add(final @NotNull BigInteger bytesToAdd) { return new Exbibyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Exbibyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Exbibyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Exbibyte divide(final long divisor) { + public @NotNull Exbibyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Exbibyte divide(@NotNull final BigInteger divisor) { + public @NotNull Exbibyte divide(final @NotNull BigInteger divisor) { return new Exbibyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Exbibyte multiply(final long factor) { + public @NotNull Exbibyte multiply(final long factor) { return new Exbibyte(bytes.multiply(BigInteger.valueOf(factor))); } @Override - @NotNull @CheckReturnValue - public Exbibyte multiply(@NotNull final BigInteger factor) { + public @NotNull Exbibyte multiply(final @NotNull BigInteger factor) { return new Exbibyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Exbibyte subtract(final long bytesToSubtract) { + public @NotNull Exbibyte subtract(final long bytesToSubtract) { return new Exbibyte(bytes.subtract(BigInteger.valueOf(bytesToSubtract))); } @Override - @NotNull @CheckReturnValue - public Exbibyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Exbibyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Exbibyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Exbibyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Exbibyte subtract(final @NotNull StorageUnit storageAmount) { return new Exbibyte(bytes.subtract(storageAmount.bytes)); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return StorageUnit.BYTES_IN_A_EXBIBYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "EiB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::binaryValueOf; } 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 d216c34..dbff355 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 @@ -17,8 +17,7 @@ final class FormatUtils { // Hidden constructor. } - @NotNull - static Format asFormat(@NotNull final String pattern, @NotNull final Locale locale) { + static @NotNull Format asFormat(final @NotNull String pattern, final @NotNull Locale locale) { final var localizedFormat = NumberFormat.getNumberInstance(locale); final var outputFormat = (DecimalFormat) localizedFormat; outputFormat.applyPattern(pattern); 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 4e32bb4..7571fef 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 @@ -19,7 +19,7 @@ public final class Gibibyte extends StorageUnit { @Serial private static final long serialVersionUID = -1104749948510944566L; - Gibibyte(@NotNull final BigInteger bytes) { + Gibibyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Gibibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Gibibyte contains. * @return A new Gibibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Gibibyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Gibibyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Gibibyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Gibibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Gibibyte contains. * @return A new Gibibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Gibibyte valueOf(final long numberOfBytes) { + public static @NotNull Gibibyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Gibibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Gibibyte contains. * @return A new Gibibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Gibibyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Gibibyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Gibibyte add(final long bytesToAdd) { + public @NotNull Gibibyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Gibibyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Gibibyte add(final @NotNull BigInteger bytesToAdd) { return new Gibibyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Gibibyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Gibibyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Gibibyte divide(final long divisor) { + public @NotNull Gibibyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Gibibyte divide(@NotNull final BigInteger divisor) { + public @NotNull Gibibyte divide(final @NotNull BigInteger divisor) { return new Gibibyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Gibibyte multiply(final long factor) { + public @NotNull Gibibyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Gibibyte multiply(@NotNull final BigInteger factor) { + public @NotNull Gibibyte multiply(final @NotNull BigInteger factor) { return new Gibibyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Gibibyte subtract(final long bytesToSubtract) { + public @NotNull Gibibyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Gibibyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Gibibyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Gibibyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Gibibyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Gibibyte subtract(final @NotNull StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return BYTES_IN_A_GIBIBYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "GiB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::binaryValueOf; } 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 639c656..2b54527 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 @@ -19,7 +19,7 @@ public final class Gigabyte extends StorageUnit { @Serial private static final long serialVersionUID = 7581075190529125530L; - Gigabyte(@NotNull final BigInteger bytes) { + Gigabyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Gigabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Gigabyte contains. * @return A new Gigabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Gigabyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Gigabyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Gigabyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Gigabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Gigabyte contains. * @return A new Gigabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Gigabyte valueOf(final long numberOfBytes) { + public static @NotNull Gigabyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Gigabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Gigabyte contains. * @return A new Gigabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Gigabyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Gigabyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Gigabyte add(final long bytesToAdd) { + public @NotNull Gigabyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Gigabyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Gigabyte add(final @NotNull BigInteger bytesToAdd) { return new Gigabyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Gigabyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Gigabyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Gigabyte divide(final long divisor) { + public @NotNull Gigabyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Gigabyte divide(@NotNull final BigInteger divisor) { + public @NotNull Gigabyte divide(final @NotNull BigInteger divisor) { return new Gigabyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Gigabyte multiply(final long factor) { + public @NotNull Gigabyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Gigabyte multiply(@NotNull final BigInteger factor) { + public @NotNull Gigabyte multiply(final @NotNull BigInteger factor) { return new Gigabyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Gigabyte subtract(final long bytesToSubtract) { + public @NotNull Gigabyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Gigabyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Gigabyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Gigabyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Gigabyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Gigabyte subtract(final @NotNull StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return BYTES_IN_A_GIGABYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "GB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::decimalValueOf; } 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 477e665..8d0e34d 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 @@ -19,7 +19,7 @@ public final class Kibibyte extends StorageUnit { @Serial private static final long serialVersionUID = 3798828851496657978L; - Kibibyte(@NotNull final BigInteger bytes) { + Kibibyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Kibibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Kibibyte contains. * @return A new Kibibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Kibibyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Kibibyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Kibibyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Kibibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Kibibyte contains. * @return A new Kibibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Kibibyte valueOf(final long numberOfBytes) { + public static @NotNull Kibibyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Kibibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Kibibyte contains. * @return A new Kibibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Kibibyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Kibibyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Kibibyte add(final long bytesToAdd) { + public @NotNull Kibibyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Kibibyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Kibibyte add(final @NotNull BigInteger bytesToAdd) { return new Kibibyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Kibibyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Kibibyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Kibibyte divide(final long divisor) { + public @NotNull Kibibyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Kibibyte divide(@NotNull final BigInteger divisor) { + public @NotNull Kibibyte divide(final @NotNull BigInteger divisor) { return new Kibibyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Kibibyte multiply(final long factor) { + public @NotNull Kibibyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Kibibyte multiply(@NotNull final BigInteger factor) { + public @NotNull Kibibyte multiply(final @NotNull BigInteger factor) { return new Kibibyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Kibibyte subtract(final long bytesToSubtract) { + public @NotNull Kibibyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Kibibyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Kibibyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Kibibyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Kibibyte subtract(final StorageUnit storageAmount) { + public @NotNull Kibibyte subtract(final StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return StorageUnit.BYTES_IN_A_KIBIBYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "KiB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::binaryValueOf; } 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 192a4d2..7b30aa2 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 @@ -19,7 +19,7 @@ public final class Kilobyte extends StorageUnit { @Serial private static final long serialVersionUID = 6952239416014811456L; - Kilobyte(@NotNull final BigInteger numberOfBytes) { + Kilobyte(final @NotNull BigInteger numberOfBytes) { super(numberOfBytes); } @@ -27,9 +27,8 @@ public final class Kilobyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Kilobyte contains. * @return A new Kilobyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Kilobyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Kilobyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Kilobyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Kilobyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Kilobyte contains. * @return A new Kilobyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Kilobyte valueOf(final long numberOfBytes) { + public static @NotNull Kilobyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Kilobyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Kilobyte contains. * @return A new Kilobyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Kilobyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Kilobyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Kilobyte add(final long bytesToAdd) { + public @NotNull Kilobyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Kilobyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Kilobyte add(final @NotNull BigInteger bytesToAdd) { return new Kilobyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Kilobyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Kilobyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Kilobyte divide(final long divisor) { + public @NotNull Kilobyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Kilobyte divide(@NotNull final BigInteger divisor) { + public @NotNull Kilobyte divide(final @NotNull BigInteger divisor) { return new Kilobyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Kilobyte multiply(final long factor) { + public @NotNull Kilobyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Kilobyte multiply(@NotNull final BigInteger factor) { + public @NotNull Kilobyte multiply(final @NotNull BigInteger factor) { return new Kilobyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Kilobyte subtract(final long bytesToSubtract) { + public @NotNull Kilobyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Kilobyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Kilobyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Kilobyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Kilobyte subtract(final StorageUnit storageAmount) { + public @NotNull Kilobyte subtract(final StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return BYTES_IN_A_KILOBYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "kB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::decimalValueOf; } 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 e2b5058..eea16da 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 @@ -19,7 +19,7 @@ public final class Mebibyte extends StorageUnit { @Serial private static final long serialVersionUID = 7697583678146919524L; - Mebibyte(@NotNull final BigInteger bytes) { + Mebibyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Mebibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Mebibyte contains. * @return A new Mebibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Mebibyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Mebibyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Mebibyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Mebibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Mebibyte contains. * @return A new Mebibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Mebibyte valueOf(final long numberOfBytes) { + public static @NotNull Mebibyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Mebibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Mebibyte contains. * @return A new Mebibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Mebibyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Mebibyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Mebibyte add(final long bytesToAdd) { + public @NotNull Mebibyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Mebibyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Mebibyte add(final @NotNull BigInteger bytesToAdd) { return new Mebibyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Mebibyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Mebibyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Mebibyte divide(final long divisor) { + public @NotNull Mebibyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Mebibyte divide(@NotNull final BigInteger divisor) { + public @NotNull Mebibyte divide(final @NotNull BigInteger divisor) { return new Mebibyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Mebibyte multiply(final long factor) { + public @NotNull Mebibyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Mebibyte multiply(@NotNull final BigInteger factor) { + public @NotNull Mebibyte multiply(final @NotNull BigInteger factor) { return new Mebibyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Mebibyte subtract(final long bytesToSubtract) { + public @NotNull Mebibyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Mebibyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Mebibyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Mebibyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Mebibyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Mebibyte subtract(final @NotNull StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return StorageUnit.BYTES_IN_A_MEBIBYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "MiB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::binaryValueOf; } 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 af0bf0f..0b55283 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 @@ -19,7 +19,7 @@ public final class Megabyte extends StorageUnit { @Serial private static final long serialVersionUID = 5901923092058760111L; - Megabyte(@NotNull final BigInteger bytes) { + Megabyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Megabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Megabyte contains. * @return A new Megabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Megabyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Megabyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Megabyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Megabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Megabyte contains. * @return A new Megabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Megabyte valueOf(final long numberOfBytes) { + public static @NotNull Megabyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Megabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Megabyte contains. * @return A new Megabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Megabyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Megabyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Megabyte add(final long bytesToAdd) { + public @NotNull Megabyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Megabyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Megabyte add(final @NotNull BigInteger bytesToAdd) { return new Megabyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Megabyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Megabyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Megabyte divide(final long divisor) { + public @NotNull Megabyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Megabyte divide(@NotNull final BigInteger divisor) { + public @NotNull Megabyte divide(final @NotNull BigInteger divisor) { return new Megabyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Megabyte multiply(final long factor) { + public @NotNull Megabyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Megabyte multiply(@NotNull final BigInteger factor) { + public @NotNull Megabyte multiply(final @NotNull BigInteger factor) { return new Megabyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Megabyte subtract(final long bytesToSubtract) { + public @NotNull Megabyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Megabyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Megabyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Megabyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Megabyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Megabyte subtract(final @NotNull StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return StorageUnit.BYTES_IN_A_MEGABYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "MB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::decimalValueOf; } 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 a2dc4cd..55dff4e 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 @@ -19,7 +19,7 @@ public final class Pebibyte extends StorageUnit { @Serial private static final long serialVersionUID = -6112472064345339882L; - Pebibyte(@NotNull final BigInteger bytes) { + Pebibyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Pebibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Pebibyte contains. * @return A new Pebibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Pebibyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Pebibyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Pebibyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Pebibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Pebibyte contains. * @return A new Pebibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Pebibyte valueOf(final long numberOfBytes) { + public static @NotNull Pebibyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Pebibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Pebibyte contains. * @return A new Pebibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Pebibyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Pebibyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Pebibyte add(final long bytesToAdd) { + public @NotNull Pebibyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Pebibyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Pebibyte add(final @NotNull BigInteger bytesToAdd) { return new Pebibyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Pebibyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Pebibyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Pebibyte divide(final long divisor) { + public @NotNull Pebibyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Pebibyte divide(@NotNull final BigInteger divisor) { + public @NotNull Pebibyte divide(final @NotNull BigInteger divisor) { return new Pebibyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Pebibyte multiply(final long factor) { + public @NotNull Pebibyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Pebibyte multiply(@NotNull final BigInteger factor) { + public @NotNull Pebibyte multiply(final @NotNull BigInteger factor) { return new Pebibyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Pebibyte subtract(final long bytesToSubtract) { + public @NotNull Pebibyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Pebibyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Pebibyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Pebibyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Pebibyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Pebibyte subtract(final @NotNull StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return StorageUnit.BYTES_IN_A_PEBIBYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "PiB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::binaryValueOf; } 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 8d9554d..a35d823 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 @@ -19,7 +19,7 @@ public final class Petabyte extends StorageUnit { @Serial private static final long serialVersionUID = 5889808368085688387L; - Petabyte(@NotNull final BigInteger bytes) { + Petabyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Petabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Petabyte contains. * @return A new Petabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Petabyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Petabyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Petabyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Petabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Petabyte contains. * @return A new Petabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Petabyte valueOf(final long numberOfBytes) { + public static @NotNull Petabyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Petabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Petabyte contains. * @return A new Petabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Petabyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Petabyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Petabyte add(final long bytesToAdd) { + public @NotNull Petabyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Petabyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Petabyte add(final @NotNull BigInteger bytesToAdd) { return new Petabyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Petabyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Petabyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Petabyte divide(final long divisor) { + public @NotNull Petabyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Petabyte divide(@NotNull final BigInteger divisor) { + public @NotNull Petabyte divide(final @NotNull BigInteger divisor) { return new Petabyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Petabyte multiply(final long factor) { + public @NotNull Petabyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Petabyte multiply(@NotNull final BigInteger factor) { + public @NotNull Petabyte multiply(final @NotNull BigInteger factor) { return new Petabyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Petabyte subtract(final long bytesToSubtract) { + public @NotNull Petabyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Petabyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Petabyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Petabyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Petabyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Petabyte subtract(final @NotNull StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return StorageUnit.BYTES_IN_A_PETABYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "PB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::decimalValueOf; } 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 c6f909d..d9e54ca 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 @@ -35,503 +35,436 @@ public abstract class StorageUnit> extends Number imple /** * Default number format used within the library. */ - @NotNull - static final String DEFAULT_FORMAT_PATTERN = "0.00"; //$NON-NLS-1$ + static final @NotNull String DEFAULT_FORMAT_PATTERN = "0.00"; //$NON-NLS-1$ /** * The storage unit base for binary numbers. Each step between the units dimensions is done with this base value. */ - @NotNull - static final BigInteger BINARY_UNIT_BASE = BigInteger.valueOf(1024); + static final @NotNull BigInteger BINARY_UNIT_BASE = BigInteger.valueOf(1024); - @NotNull - static final BigInteger BYTES_IN_A_KIBIBYTE = BigInteger.ONE.multiply(StorageUnit.BINARY_UNIT_BASE); + static final @NotNull BigInteger BYTES_IN_A_KIBIBYTE = BigInteger.ONE.multiply(StorageUnit.BINARY_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_MEBIBYTE = StorageUnit.BYTES_IN_A_KIBIBYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_MEBIBYTE = StorageUnit.BYTES_IN_A_KIBIBYTE.multiply( StorageUnit.BINARY_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_GIBIBYTE = StorageUnit.BYTES_IN_A_MEBIBYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_GIBIBYTE = StorageUnit.BYTES_IN_A_MEBIBYTE.multiply( StorageUnit.BINARY_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_TEBIBYTE = StorageUnit.BYTES_IN_A_GIBIBYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_TEBIBYTE = StorageUnit.BYTES_IN_A_GIBIBYTE.multiply( StorageUnit.BINARY_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_PEBIBYTE = StorageUnit.BYTES_IN_A_TEBIBYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_PEBIBYTE = StorageUnit.BYTES_IN_A_TEBIBYTE.multiply( StorageUnit.BINARY_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_EXBIBYTE = StorageUnit.BYTES_IN_A_PEBIBYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_EXBIBYTE = StorageUnit.BYTES_IN_A_PEBIBYTE.multiply( StorageUnit.BINARY_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_ZEBIBYTE = StorageUnit.BYTES_IN_A_EXBIBYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_ZEBIBYTE = StorageUnit.BYTES_IN_A_EXBIBYTE.multiply( StorageUnit.BINARY_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_YOBIBYTE = StorageUnit.BYTES_IN_A_ZEBIBYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_YOBIBYTE = StorageUnit.BYTES_IN_A_ZEBIBYTE.multiply( StorageUnit.BINARY_UNIT_BASE); /** * The storage unit base for decimal numbers. Each step between the units dimensions is done with this base value. */ - @NotNull - static final BigInteger DECIMAL_UNIT_BASE = BigInteger.valueOf(1000); + static final @NotNull BigInteger DECIMAL_UNIT_BASE = BigInteger.valueOf(1000); - @NotNull - static final BigInteger BYTES_IN_A_KILOBYTE = BigInteger.ONE.multiply( + static final @NotNull BigInteger BYTES_IN_A_KILOBYTE = BigInteger.ONE.multiply( StorageUnit.DECIMAL_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_MEGABYTE = StorageUnit.BYTES_IN_A_KILOBYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_MEGABYTE = StorageUnit.BYTES_IN_A_KILOBYTE.multiply( StorageUnit.DECIMAL_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_GIGABYTE = StorageUnit.BYTES_IN_A_MEGABYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_GIGABYTE = StorageUnit.BYTES_IN_A_MEGABYTE.multiply( StorageUnit.DECIMAL_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_TERABYTE = StorageUnit.BYTES_IN_A_GIGABYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_TERABYTE = StorageUnit.BYTES_IN_A_GIGABYTE.multiply( StorageUnit.DECIMAL_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_PETABYTE = StorageUnit.BYTES_IN_A_TERABYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_PETABYTE = StorageUnit.BYTES_IN_A_TERABYTE.multiply( StorageUnit.DECIMAL_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_EXABYTE = StorageUnit.BYTES_IN_A_PETABYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_EXABYTE = StorageUnit.BYTES_IN_A_PETABYTE.multiply( StorageUnit.DECIMAL_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_ZETTABYTE = StorageUnit.BYTES_IN_A_EXABYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_ZETTABYTE = StorageUnit.BYTES_IN_A_EXABYTE.multiply( StorageUnit.DECIMAL_UNIT_BASE); - @NotNull - static final BigInteger BYTES_IN_A_YOTTABYTE = StorageUnit.BYTES_IN_A_ZETTABYTE.multiply( + static final @NotNull BigInteger BYTES_IN_A_YOTTABYTE = StorageUnit.BYTES_IN_A_ZETTABYTE.multiply( StorageUnit.DECIMAL_UNIT_BASE); - @NotNull - protected final BigInteger bytes; + protected final @NotNull BigInteger bytes; - protected StorageUnit(@NotNull final BigInteger bytes) { + protected StorageUnit(final @NotNull BigInteger bytes) { this.bytes = bytes; } /** * @return This storage unit as the best matching binary unit. */ - @NotNull @CheckReturnValue - public final StorageUnit asBestMatchingBinaryUnit() { + public final @NotNull StorageUnit asBestMatchingBinaryUnit() { return StorageUnits.binaryValueOf(this.bytes); } /** * @return This storage unit as the best matching decimal unit. */ - @NotNull @CheckReturnValue - public final StorageUnit asBestMatchingDecimalUnit() { + public final @NotNull StorageUnit asBestMatchingDecimalUnit() { return StorageUnits.decimalValueOf(this.bytes); } /** * @return This storage unit as the best matching unit, while keeping the current type (binary, decimal, common). */ - @NotNull @CheckReturnValue - public final StorageUnit asBestMatchingUnit() { + public final @NotNull StorageUnit asBestMatchingUnit() { return converter().apply(this.bytes); } - @NotNull - protected abstract Function<@NotNull BigInteger, @NotNull StorageUnit> converter(); + protected abstract @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter(); /** * @return This storage unit as bytes. */ - @NotNull @CheckReturnValue - public final Byte asByte() { + public final @NotNull Byte asByte() { return new Byte(this.bytes); } /** * @return This storage unit as a kibibyte. */ - @NotNull @CheckReturnValue - public final Kibibyte asKibibyte() { + public final @NotNull Kibibyte asKibibyte() { return new Kibibyte(this.bytes); } /** * @return This storage unit as a mebibyte. */ - @NotNull @CheckReturnValue - public final Mebibyte asMebibyte() { + public final @NotNull Mebibyte asMebibyte() { return new Mebibyte(this.bytes); } /** * @return This storage unit as a gibibyte. */ - @NotNull @CheckReturnValue - public final Gibibyte asGibibyte() { + public final @NotNull Gibibyte asGibibyte() { return new Gibibyte(this.bytes); } /** * @return This storage unit as a tebibyte. */ - @NotNull @CheckReturnValue - public final Tebibyte asTebibyte() { + public final @NotNull Tebibyte asTebibyte() { return new Tebibyte(this.bytes); } /** * @return This storage unit as a pebibyte. */ - @NotNull @CheckReturnValue - public final Pebibyte asPebibyte() { + public final @NotNull Pebibyte asPebibyte() { return new Pebibyte(this.bytes); } /** * @return This storage unit as a exbibyte. */ - @NotNull @CheckReturnValue - public final Exbibyte asExbibyte() { + public final @NotNull Exbibyte asExbibyte() { return new Exbibyte(this.bytes); } /** * @return This storage unit as a zebibyte. */ - @NotNull @CheckReturnValue - public final Zebibyte asZebibyte() { + public final @NotNull Zebibyte asZebibyte() { return new Zebibyte(this.bytes); } /** * @return This storage unit as a yobibyte. */ - @NotNull @CheckReturnValue - public final Yobibyte asYobibyte() { + public final @NotNull Yobibyte asYobibyte() { return new Yobibyte(this.bytes); } /** * @return This storage unit as a kilobyte. */ - @NotNull @CheckReturnValue - public final Kilobyte asKilobyte() { + public final @NotNull Kilobyte asKilobyte() { return new Kilobyte(this.bytes); } /** * @return This storage unit as a megabyte. */ - @NotNull @CheckReturnValue - public final Megabyte asMegabyte() { + public final @NotNull Megabyte asMegabyte() { return new Megabyte(this.bytes); } /** * @return This storage unit as a gigabyte. */ - @NotNull @CheckReturnValue - public final Gigabyte asGigabyte() { + public final @NotNull Gigabyte asGigabyte() { return new Gigabyte(this.bytes); } /** * @return This storage unit as a terabyte. */ - @NotNull @CheckReturnValue - public final Terabyte asTerabyte() { + public final @NotNull Terabyte asTerabyte() { return new Terabyte(this.bytes); } /** * @return This storage unit as a petabyte. */ - @NotNull @CheckReturnValue - public final Petabyte asPetabyte() { + public final @NotNull Petabyte asPetabyte() { return new Petabyte(this.bytes); } /** * @return This storage unit as a exabyte. */ - @NotNull @CheckReturnValue - public final Exabyte asExabyte() { + public final @NotNull Exabyte asExabyte() { return new Exabyte(this.bytes); } /** * @return This storage unit as a zettabyte. */ - @NotNull @CheckReturnValue - public final Zettabyte asZettabyte() { + public final @NotNull Zettabyte asZettabyte() { return new Zettabyte(this.bytes); } /** * @return This storage unit as a yottabyte. */ - @NotNull @CheckReturnValue - public final Yottabyte asYottabyte() { + public final @NotNull Yottabyte asYottabyte() { return new Yottabyte(this.bytes); } /** * @return The amount of bytes this storage unit encompasses. */ - @NotNull @CheckReturnValue - public final BigInteger inByte() { + public final @NotNull BigInteger inByte() { return this.bytes; } /** * @return This storage unit quantified as kibibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inKibibyte() { + public final @NotNull BigDecimal inKibibyte() { return this.calculate(StorageUnit.BYTES_IN_A_KIBIBYTE); } /** * @return This storage unit quantified as mebibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inMebibyte() { + public final @NotNull BigDecimal inMebibyte() { return this.calculate(StorageUnit.BYTES_IN_A_MEBIBYTE); } /** * @return This storage unit quantified as gibibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inGibibyte() { + public final @NotNull BigDecimal inGibibyte() { return this.calculate(StorageUnit.BYTES_IN_A_GIBIBYTE); } /** * @return This storage unit quantified as tebibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inTebibyte() { + public final @NotNull BigDecimal inTebibyte() { return this.calculate(StorageUnit.BYTES_IN_A_TEBIBYTE); } /** * @return This storage unit quantified as pebibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inPebibyte() { + public final @NotNull BigDecimal inPebibyte() { return this.calculate(StorageUnit.BYTES_IN_A_PEBIBYTE); } /** * @return This storage unit quantified as exbibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inExbibyte() { + public final @NotNull BigDecimal inExbibyte() { return this.calculate(StorageUnit.BYTES_IN_A_EXBIBYTE); } /** * @return This storage unit quantified as zebibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inZebibyte() { + public final @NotNull BigDecimal inZebibyte() { return this.calculate(StorageUnit.BYTES_IN_A_ZEBIBYTE); } /** * @return This storage unit quantified as yobibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inYobibyte() { + public final @NotNull BigDecimal inYobibyte() { return this.calculate(StorageUnit.BYTES_IN_A_YOBIBYTE); } /** * @return This storage unit quantified as kilobyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inKilobyte() { + public final @NotNull BigDecimal inKilobyte() { return this.calculate(StorageUnit.BYTES_IN_A_KILOBYTE); } /** * @return This storage unit quantified as megabyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inMegabyte() { + public final @NotNull BigDecimal inMegabyte() { return this.calculate(StorageUnit.BYTES_IN_A_MEGABYTE); } /** * @return This storage unit quantified as gigabyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inGigabyte() { + public final @NotNull BigDecimal inGigabyte() { return this.calculate(StorageUnit.BYTES_IN_A_GIGABYTE); } /** * @return This storage unit quantified as terabyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inTerabyte() { + public final @NotNull BigDecimal inTerabyte() { return this.calculate(StorageUnit.BYTES_IN_A_TERABYTE); } /** * @return This storage unit quantified as petabyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inPetabyte() { + public final @NotNull BigDecimal inPetabyte() { return this.calculate(StorageUnit.BYTES_IN_A_PETABYTE); } /** * @return This storage unit quantified as exabyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inExabyte() { + public final @NotNull BigDecimal inExabyte() { return this.calculate(StorageUnit.BYTES_IN_A_EXABYTE); } /** * @return This storage unit quantified as zettabyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inZettabyte() { + public final @NotNull BigDecimal inZettabyte() { return this.calculate(StorageUnit.BYTES_IN_A_ZETTABYTE); } /** * @return This storage unit quantified as yottabyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inYottabyte() { + public final @NotNull BigDecimal inYottabyte() { return this.calculate(StorageUnit.BYTES_IN_A_YOTTABYTE); } /** * @return This storage unit quantified as common kibibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inCommonKilobyte() { + public final @NotNull BigDecimal inCommonKilobyte() { return this.calculate(StorageUnit.BYTES_IN_A_KIBIBYTE); } /** * @return This storage unit quantified as common mebibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inCommonMegabyte() { + public final @NotNull BigDecimal inCommonMegabyte() { return this.calculate(StorageUnit.BYTES_IN_A_MEBIBYTE); } /** * @return This storage unit quantified as common gibibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inCommonGigabyte() { + public final @NotNull BigDecimal inCommonGigabyte() { return this.calculate(StorageUnit.BYTES_IN_A_GIBIBYTE); } /** * @return This storage unit quantified as common tebibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inCommonTerabyte() { + public final @NotNull BigDecimal inCommonTerabyte() { return this.calculate(StorageUnit.BYTES_IN_A_TEBIBYTE); } /** * @return This storage unit quantified as common pebibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inCommonPetabyte() { + public final @NotNull BigDecimal inCommonPetabyte() { return this.calculate(StorageUnit.BYTES_IN_A_PEBIBYTE); } /** * @return This storage unit quantified as common exbibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inCommonExabyte() { + public final @NotNull BigDecimal inCommonExabyte() { return this.calculate(StorageUnit.BYTES_IN_A_EXBIBYTE); } /** * @return This storage unit quantified as common zebibyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inCommonZettabyte() { + public final @NotNull BigDecimal inCommonZettabyte() { return this.calculate(StorageUnit.BYTES_IN_A_ZEBIBYTE); } /** * @return This storage unit quantified as common yottabyte. */ - @NotNull @CheckReturnValue - public final BigDecimal inCommonYottabyte() { + public final @NotNull BigDecimal inCommonYottabyte() { return this.calculate(StorageUnit.BYTES_IN_A_YOBIBYTE); } - @NotNull @Override @CheckReturnValue - public final String toString() { + public final @NotNull String toString() { return this.toString(DEFAULT_FORMAT_PATTERN); } @@ -541,9 +474,8 @@ public abstract class StorageUnit> extends Number imple * @param pattern The {@link Format} pattern to apply. * @return The formatted representation of this storage unit. */ - @NotNull @CheckReturnValue - public final String toString(final String pattern) { + public final @NotNull String toString(final String pattern) { return this.toString(new DecimalFormat(pattern)); } @@ -554,9 +486,8 @@ public abstract class StorageUnit> extends Number imple * @param locale The locale to use. * @return The formatted representation of this storage unit. */ - @NotNull @CheckReturnValue - public final String toString(final String pattern, final Locale locale) { + public final @NotNull String toString(final String pattern, final Locale locale) { return this.toString(asFormat(pattern, locale)); } @@ -568,17 +499,15 @@ public abstract class StorageUnit> extends Number imple * @param format The custom format to use. * @return The formatted representation of this storage unit. */ - @NotNull @CheckReturnValue - public final String toString(final Format format) { + public final @NotNull String toString(final Format format) { final BigDecimal amount = this.calculate(this.getNumberOfBytesPerUnit()); final String formattedAmount = format.format(amount); return String.format("%s %s", formattedAmount, getSymbol()); } - @NotNull @CheckReturnValue - private BigDecimal calculate(final BigInteger base) { + private @NotNull BigDecimal calculate(final BigInteger base) { return new BigDecimal(this.bytes) .divide(new BigDecimal(base), StorageUnit.DEFAULT_SCALE, RoundingMode.CEILING); } @@ -626,76 +555,64 @@ public abstract class StorageUnit> extends Number imple * @param bytesToAdd The amount of bytes to add. * @return The new amount of storage in the appropriate type. */ - @NotNull - public abstract T add(long bytesToAdd); + public abstract @NotNull T add(long bytesToAdd); /** * @param bytesToAdd The amount of bytes to add. * @return The new amount of storage in the appropriate type. */ - @NotNull - public abstract T add(@NotNull BigInteger bytesToAdd); + public abstract @NotNull T add(@NotNull BigInteger bytesToAdd); /** * @param storageAmount The amount of storage to add. * @return The new amount of storage in the appropriate type. */ - @NotNull - public abstract T add(@NotNull StorageUnit storageAmount); + public abstract @NotNull T add(@NotNull StorageUnit storageAmount); /** * @param divisor The divisor to apply. * @return The new amount of storage in the appropriate type. */ - @NotNull - public abstract T divide(long divisor); + public abstract @NotNull T divide(long divisor); /** * @param divisor The divisor to apply. * @return The new amount of storage in the appropriate type. */ - @NotNull - public abstract T divide(@NotNull BigInteger divisor); + public abstract @NotNull T divide(@NotNull BigInteger divisor); /** * @param factor The factor to apply. * @return The new amount of storage in the appropriate type. */ - @NotNull - public abstract T multiply(long factor); + public abstract @NotNull T multiply(long factor); /** * @param factor The factor to apply. * @return The new amount of storage in the appropriate type. */ - @NotNull - public abstract T multiply(@NotNull BigInteger factor); + public abstract @NotNull T multiply(@NotNull BigInteger factor); /** * @param bytesToSubtract The amount of bytes to subtract. * @return The new amount of storage in the appropriate type. */ - @NotNull - public abstract T subtract(long bytesToSubtract); + public abstract @NotNull T subtract(long bytesToSubtract); /** * @param bytesToSubtract The amount of bytes to subtract. * @return The new amount of storage in the appropriate type. */ - @NotNull - public abstract T subtract(@NotNull BigInteger bytesToSubtract); + public abstract @NotNull T subtract(@NotNull BigInteger bytesToSubtract); /** * @param storageAmount The amount of storage to subtract. * @return The new amount of storage in the appropriate type. */ - @NotNull - public abstract T subtract(@NotNull StorageUnit storageAmount); + public abstract @NotNull T subtract(@NotNull StorageUnit storageAmount); - @NotNull - protected abstract BigInteger getNumberOfBytesPerUnit(); + protected abstract @NotNull BigInteger getNumberOfBytesPerUnit(); - @NotNull - protected abstract String getSymbol(); + protected abstract @NotNull String getSymbol(); } 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 715c57c..da3bd2c 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 @@ -27,9 +27,8 @@ public final class StorageUnits { * @param bytes The amount to bytes to represent. * @return The appropriate binary-prefixed unit for the given amount of bytes. */ - @NotNull @CheckReturnValue - public static StorageUnit binaryValueOf(final long bytes) { + public static @NotNull StorageUnit binaryValueOf(final long bytes) { return binaryValueOf(BigInteger.valueOf(bytes)); } @@ -37,11 +36,10 @@ public final class StorageUnits { * @param bytes The amount to bytes to represent. * @return The appropriate binary-prefixed unit for the given amount of bytes. */ - @NotNull @CheckReturnValue - public static StorageUnit binaryValueOf(@NotNull final BigInteger bytes) { + public static @NotNull StorageUnit binaryValueOf(final @NotNull BigInteger bytes) { StorageUnit unit = Byte.valueOf(bytes); - @NotNull final BigInteger positiveNumberOfBytes = bytes.signum() == -1 ? bytes.negate() : bytes; + final @NotNull BigInteger positiveNumberOfBytes = bytes.signum() == -1 ? bytes.negate() : bytes; if (inbetween(StorageUnit.BYTES_IN_A_KIBIBYTE, positiveNumberOfBytes, StorageUnit.BYTES_IN_A_MEBIBYTE)) { unit = unit.asKibibyte(); @@ -68,9 +66,8 @@ public final class StorageUnits { * @param bytes The amount of bytes to represent. * @return The appropriate decimal unit for the given amount of bytes. */ - @NotNull @CheckReturnValue - public static StorageUnit decimalValueOf(final long bytes) { + public static @NotNull StorageUnit decimalValueOf(final long bytes) { return decimalValueOf(BigInteger.valueOf(bytes)); } @@ -78,11 +75,10 @@ public final class StorageUnits { * @param bytes The amount of bytes to represent. * @return The appropriate decimal unit for the given amount of bytes. */ - @NotNull @CheckReturnValue - public static StorageUnit decimalValueOf(@NotNull final BigInteger bytes) { + public static @NotNull StorageUnit decimalValueOf(final @NotNull BigInteger bytes) { StorageUnit unit = Byte.valueOf(bytes); - @NotNull final BigInteger positiveNumberOfBytes = bytes.signum() == -1 ? bytes.negate() : bytes; + final @NotNull BigInteger positiveNumberOfBytes = bytes.signum() == -1 ? bytes.negate() : bytes; if (inbetween(StorageUnit.BYTES_IN_A_KILOBYTE, positiveNumberOfBytes, StorageUnit.BYTES_IN_A_MEGABYTE)) { unit = unit.asKilobyte(); @@ -119,9 +115,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsByte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsByte(final @NotNull Long numberOfBytes) { return formatAsByte(numberOfBytes.longValue()); } @@ -129,9 +124,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsByte(final long numberOfBytes) { + public static @NotNull String formatAsByte(final long numberOfBytes) { return formatAsByte(BigInteger.valueOf(numberOfBytes)); } @@ -139,9 +133,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsByte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsByte(final @NotNull BigInteger numberOfBytes) { return numberOfBytes + " B"; } @@ -149,9 +142,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsBinaryUnit(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsBinaryUnit(final @NotNull Long numberOfBytes) { return formatAsBinaryUnit(numberOfBytes.longValue()); } @@ -159,9 +151,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsBinaryUnit(final long numberOfBytes) { + public static @NotNull String formatAsBinaryUnit(final long numberOfBytes) { return formatAsBinaryUnit(BigInteger.valueOf(numberOfBytes)); } @@ -169,9 +160,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsBinaryUnit(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsBinaryUnit(final @NotNull BigInteger numberOfBytes) { return formatAsBinaryUnit(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -180,9 +170,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsBinaryUnit(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsBinaryUnit(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsBinaryUnit(numberOfBytes.longValue(), pattern); } @@ -191,9 +180,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsBinaryUnit(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsBinaryUnit(final long numberOfBytes, final @NotNull String pattern) { return formatAsBinaryUnit(BigInteger.valueOf(numberOfBytes), pattern); } @@ -202,9 +190,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsBinaryUnit(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsBinaryUnit(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsBinaryUnit(numberOfBytes, new DecimalFormat(pattern)); } @@ -214,12 +201,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsBinaryUnit( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsBinaryUnit( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsBinaryUnit(numberOfBytes.longValue(), pattern, locale); } @@ -229,12 +215,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsBinaryUnit( + public static @NotNull String formatAsBinaryUnit( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsBinaryUnit(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -244,12 +229,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsBinaryUnit( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsBinaryUnit( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsBinaryUnit(numberOfBytes, asFormat(pattern, locale)); } @@ -258,9 +242,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsBinaryUnit(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsBinaryUnit(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsBinaryUnit(numberOfBytes.longValue(), format); } @@ -269,9 +252,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsBinaryUnit(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsBinaryUnit(final long numberOfBytes, final @NotNull Format format) { return formatAsBinaryUnit(BigInteger.valueOf(numberOfBytes), format); } @@ -280,9 +262,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsBinaryUnit(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsBinaryUnit(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return binaryValueOf(numberOfBytes).toString(format); } @@ -290,9 +271,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKibibyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsKibibyte(final @NotNull Long numberOfBytes) { return formatAsKibibyte(numberOfBytes.longValue()); } @@ -300,9 +280,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKibibyte(final long numberOfBytes) { + public static @NotNull String formatAsKibibyte(final long numberOfBytes) { return formatAsKibibyte(BigInteger.valueOf(numberOfBytes)); } @@ -310,9 +289,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKibibyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsKibibyte(final @NotNull BigInteger numberOfBytes) { return formatAsKibibyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -321,9 +299,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKibibyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsKibibyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsKibibyte(numberOfBytes.longValue(), pattern); } @@ -332,9 +309,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKibibyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsKibibyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsKibibyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -343,9 +319,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKibibyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsKibibyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsKibibyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -355,12 +330,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKibibyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsKibibyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsKibibyte(numberOfBytes.longValue(), pattern, locale); } @@ -370,12 +344,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKibibyte( + public static @NotNull String formatAsKibibyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsKibibyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -385,12 +358,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKibibyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsKibibyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsKibibyte(numberOfBytes, asFormat(pattern, locale)); } @@ -399,9 +371,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKibibyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsKibibyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsKibibyte(numberOfBytes.longValue(), format); } @@ -410,9 +381,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKibibyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsKibibyte(final long numberOfBytes, final @NotNull Format format) { return formatAsKibibyte(BigInteger.valueOf(numberOfBytes), format); } @@ -421,9 +391,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKibibyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsKibibyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Kibibyte.valueOf(numberOfBytes).toString(format); } @@ -431,9 +400,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMebibyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsMebibyte(final @NotNull Long numberOfBytes) { return formatAsMebibyte(numberOfBytes.longValue()); } @@ -441,9 +409,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMebibyte(final long numberOfBytes) { + public static @NotNull String formatAsMebibyte(final long numberOfBytes) { return formatAsMebibyte(BigInteger.valueOf(numberOfBytes)); } @@ -451,9 +418,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMebibyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsMebibyte(final @NotNull BigInteger numberOfBytes) { return formatAsMebibyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -462,9 +428,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMebibyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsMebibyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsMebibyte(numberOfBytes.longValue(), pattern); } @@ -473,9 +438,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMebibyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsMebibyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsMebibyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -484,9 +448,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMebibyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsMebibyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsMebibyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -496,12 +459,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMebibyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsMebibyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsMebibyte(numberOfBytes.longValue(), pattern, locale); } @@ -511,12 +473,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMebibyte( + public static @NotNull String formatAsMebibyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsMebibyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -526,12 +487,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMebibyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsMebibyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsMebibyte(numberOfBytes, asFormat(pattern, locale)); } @@ -540,9 +500,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMebibyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsMebibyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsMebibyte(numberOfBytes.longValue(), format); } @@ -551,9 +510,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMebibyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsMebibyte(final long numberOfBytes, final @NotNull Format format) { return formatAsMebibyte(BigInteger.valueOf(numberOfBytes), format); } @@ -562,9 +520,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMebibyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsMebibyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Mebibyte.valueOf(numberOfBytes).toString(format); } @@ -572,9 +529,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGibibyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsGibibyte(final @NotNull Long numberOfBytes) { return formatAsGibibyte(numberOfBytes.longValue()); } @@ -582,9 +538,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGibibyte(final long numberOfBytes) { + public static @NotNull String formatAsGibibyte(final long numberOfBytes) { return formatAsGibibyte(BigInteger.valueOf(numberOfBytes)); } @@ -592,9 +547,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGibibyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsGibibyte(final @NotNull BigInteger numberOfBytes) { return formatAsGibibyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -603,9 +557,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGibibyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsGibibyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsGibibyte(numberOfBytes.longValue(), pattern); } @@ -614,9 +567,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGibibyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsGibibyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsGibibyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -625,9 +577,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGibibyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsGibibyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsGibibyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -637,12 +588,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGibibyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsGibibyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsGibibyte(numberOfBytes.longValue(), pattern, locale); } @@ -652,12 +602,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGibibyte( + public static @NotNull String formatAsGibibyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsGibibyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -667,12 +616,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGibibyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsGibibyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsGibibyte(numberOfBytes, asFormat(pattern, locale)); } @@ -681,9 +629,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGibibyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsGibibyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsGibibyte(numberOfBytes.longValue(), format); } @@ -692,9 +639,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGibibyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsGibibyte(final long numberOfBytes, final @NotNull Format format) { return formatAsGibibyte(BigInteger.valueOf(numberOfBytes), format); } @@ -703,9 +649,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGibibyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsGibibyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Gibibyte.valueOf(numberOfBytes).toString(format); } @@ -713,9 +658,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTebibyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsTebibyte(final @NotNull Long numberOfBytes) { return formatAsTebibyte(numberOfBytes.longValue()); } @@ -723,9 +667,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTebibyte(final long numberOfBytes) { + public static @NotNull String formatAsTebibyte(final long numberOfBytes) { return formatAsTebibyte(BigInteger.valueOf(numberOfBytes)); } @@ -733,9 +676,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTebibyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsTebibyte(final @NotNull BigInteger numberOfBytes) { return formatAsTebibyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -744,9 +686,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTebibyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsTebibyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsTebibyte(numberOfBytes.longValue(), pattern); } @@ -755,9 +696,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTebibyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsTebibyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsTebibyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -766,9 +706,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTebibyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsTebibyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsTebibyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -778,12 +717,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTebibyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsTebibyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsTebibyte(numberOfBytes.longValue(), pattern, locale); } @@ -793,12 +731,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTebibyte( + public static @NotNull String formatAsTebibyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsTebibyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -808,12 +745,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTebibyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsTebibyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsTebibyte(numberOfBytes, asFormat(pattern, locale)); } @@ -822,9 +758,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTebibyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsTebibyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsTebibyte(numberOfBytes.longValue(), format); } @@ -833,9 +768,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTebibyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsTebibyte(final long numberOfBytes, final @NotNull Format format) { return formatAsTebibyte(BigInteger.valueOf(numberOfBytes), format); } @@ -844,9 +778,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTebibyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsTebibyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Tebibyte.valueOf(numberOfBytes).toString(format); } @@ -854,9 +787,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPebibyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsPebibyte(final @NotNull Long numberOfBytes) { return formatAsPebibyte(numberOfBytes.longValue()); } @@ -864,9 +796,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPebibyte(final long numberOfBytes) { + public static @NotNull String formatAsPebibyte(final long numberOfBytes) { return formatAsPebibyte(BigInteger.valueOf(numberOfBytes)); } @@ -874,9 +805,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPebibyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsPebibyte(final @NotNull BigInteger numberOfBytes) { return formatAsPebibyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -885,9 +815,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPebibyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsPebibyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsPebibyte(numberOfBytes.longValue(), pattern); } @@ -896,9 +825,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPebibyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsPebibyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsPebibyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -907,9 +835,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPebibyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsPebibyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsPebibyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -919,12 +846,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPebibyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsPebibyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsPebibyte(numberOfBytes.longValue(), pattern, locale); } @@ -934,12 +860,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPebibyte( + public static @NotNull String formatAsPebibyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsPebibyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -949,12 +874,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPebibyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsPebibyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsPebibyte(numberOfBytes, asFormat(pattern, locale)); } @@ -963,9 +887,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPebibyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsPebibyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsPebibyte(numberOfBytes.longValue(), format); } @@ -974,9 +897,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPebibyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsPebibyte(final long numberOfBytes, final @NotNull Format format) { return formatAsPebibyte(BigInteger.valueOf(numberOfBytes), format); } @@ -985,9 +907,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPebibyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsPebibyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Pebibyte.valueOf(numberOfBytes).toString(format); } @@ -995,9 +916,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExbibyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsExbibyte(final @NotNull Long numberOfBytes) { return formatAsExbibyte(numberOfBytes.longValue()); } @@ -1005,9 +925,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExbibyte(final long numberOfBytes) { + public static @NotNull String formatAsExbibyte(final long numberOfBytes) { return formatAsExbibyte(BigInteger.valueOf(numberOfBytes)); } @@ -1015,9 +934,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExbibyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsExbibyte(final @NotNull BigInteger numberOfBytes) { return formatAsExbibyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -1026,9 +944,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExbibyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsExbibyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsExbibyte(numberOfBytes.longValue(), pattern); } @@ -1037,9 +954,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExbibyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsExbibyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsExbibyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -1048,9 +964,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExbibyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsExbibyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsExbibyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -1060,12 +975,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExbibyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsExbibyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsExbibyte(numberOfBytes.longValue(), pattern, locale); } @@ -1075,12 +989,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExbibyte( + public static @NotNull String formatAsExbibyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsExbibyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -1090,12 +1003,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExbibyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsExbibyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsExbibyte(numberOfBytes, asFormat(pattern, locale)); } @@ -1104,9 +1016,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExbibyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsExbibyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsExbibyte(numberOfBytes.longValue(), format); } @@ -1115,9 +1026,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExbibyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsExbibyte(final long numberOfBytes, final @NotNull Format format) { return formatAsExbibyte(BigInteger.valueOf(numberOfBytes), format); } @@ -1126,9 +1036,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExbibyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsExbibyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Exbibyte.valueOf(numberOfBytes).toString(format); } @@ -1136,9 +1045,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZebibyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsZebibyte(final @NotNull Long numberOfBytes) { return formatAsZebibyte(numberOfBytes.longValue()); } @@ -1146,9 +1054,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZebibyte(final long numberOfBytes) { + public static @NotNull String formatAsZebibyte(final long numberOfBytes) { return formatAsZebibyte(BigInteger.valueOf(numberOfBytes)); } @@ -1156,9 +1063,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZebibyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsZebibyte(final @NotNull BigInteger numberOfBytes) { return formatAsZebibyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -1167,9 +1073,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZebibyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsZebibyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsZebibyte(numberOfBytes.longValue(), pattern); } @@ -1178,9 +1083,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZebibyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsZebibyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsZebibyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -1189,9 +1093,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZebibyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsZebibyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsZebibyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -1201,12 +1104,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZebibyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsZebibyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsZebibyte(numberOfBytes.longValue(), pattern, locale); } @@ -1216,12 +1118,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZebibyte( + public static @NotNull String formatAsZebibyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsZebibyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -1231,12 +1132,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZebibyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsZebibyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsZebibyte(numberOfBytes, asFormat(pattern, locale)); } @@ -1245,9 +1145,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZebibyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsZebibyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsZebibyte(numberOfBytes.longValue(), format); } @@ -1256,9 +1155,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZebibyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsZebibyte(final long numberOfBytes, final @NotNull Format format) { return formatAsZebibyte(BigInteger.valueOf(numberOfBytes), format); } @@ -1267,9 +1165,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZebibyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsZebibyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Zebibyte.valueOf(numberOfBytes).toString(format); } @@ -1277,9 +1174,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYobibyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsYobibyte(final @NotNull Long numberOfBytes) { return formatAsYobibyte(numberOfBytes.longValue()); } @@ -1287,9 +1183,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYobibyte(final long numberOfBytes) { + public static @NotNull String formatAsYobibyte(final long numberOfBytes) { return formatAsYobibyte(BigInteger.valueOf(numberOfBytes)); } @@ -1297,9 +1192,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYobibyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsYobibyte(final @NotNull BigInteger numberOfBytes) { return formatAsYobibyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -1308,9 +1202,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYobibyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsYobibyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsYobibyte(numberOfBytes.longValue(), pattern); } @@ -1319,9 +1212,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYobibyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsYobibyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsYobibyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -1330,9 +1222,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYobibyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsYobibyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsYobibyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -1342,12 +1233,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYobibyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsYobibyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsYobibyte(numberOfBytes.longValue(), pattern, locale); } @@ -1357,12 +1247,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYobibyte( + public static @NotNull String formatAsYobibyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsYobibyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -1372,12 +1261,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYobibyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsYobibyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsYobibyte(numberOfBytes, asFormat(pattern, locale)); } @@ -1386,9 +1274,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYobibyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsYobibyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsYobibyte(numberOfBytes.longValue(), format); } @@ -1397,9 +1284,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYobibyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsYobibyte(final long numberOfBytes, final @NotNull Format format) { return formatAsYobibyte(BigInteger.valueOf(numberOfBytes), format); } @@ -1408,9 +1294,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYobibyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsYobibyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Yobibyte.valueOf(numberOfBytes).toString(format); } @@ -1418,9 +1303,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsDecimalUnit(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsDecimalUnit(final @NotNull Long numberOfBytes) { return formatAsDecimalUnit(numberOfBytes.longValue()); } @@ -1428,9 +1312,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsDecimalUnit(final long numberOfBytes) { + public static @NotNull String formatAsDecimalUnit(final long numberOfBytes) { return formatAsDecimalUnit(BigInteger.valueOf(numberOfBytes)); } @@ -1438,9 +1321,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsDecimalUnit(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsDecimalUnit(final @NotNull BigInteger numberOfBytes) { return formatAsDecimalUnit(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -1449,9 +1331,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsDecimalUnit(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsDecimalUnit(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsDecimalUnit(numberOfBytes.longValue(), pattern); } @@ -1460,9 +1341,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsDecimalUnit(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsDecimalUnit(final long numberOfBytes, final @NotNull String pattern) { return formatAsDecimalUnit(BigInteger.valueOf(numberOfBytes), pattern); } @@ -1471,9 +1351,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsDecimalUnit(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsDecimalUnit(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsDecimalUnit(numberOfBytes, new DecimalFormat(pattern)); } @@ -1483,12 +1362,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsDecimalUnit( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsDecimalUnit( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsDecimalUnit(numberOfBytes.longValue(), pattern, locale); } @@ -1498,12 +1376,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsDecimalUnit( + public static @NotNull String formatAsDecimalUnit( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsDecimalUnit(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -1513,12 +1390,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsDecimalUnit( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsDecimalUnit( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsDecimalUnit(numberOfBytes, asFormat(pattern, locale)); } @@ -1527,9 +1403,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsDecimalUnit(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsDecimalUnit(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsDecimalUnit(numberOfBytes.longValue(), format); } @@ -1538,9 +1413,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsDecimalUnit(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsDecimalUnit(final long numberOfBytes, final @NotNull Format format) { return formatAsDecimalUnit(BigInteger.valueOf(numberOfBytes), format); } @@ -1549,9 +1423,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsDecimalUnit(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsDecimalUnit(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return decimalValueOf(numberOfBytes).toString(format); } @@ -1559,9 +1432,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKilobyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsKilobyte(final @NotNull Long numberOfBytes) { return formatAsKilobyte(numberOfBytes.longValue()); } @@ -1569,9 +1441,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKilobyte(final long numberOfBytes) { + public static @NotNull String formatAsKilobyte(final long numberOfBytes) { return formatAsKilobyte(BigInteger.valueOf(numberOfBytes)); } @@ -1579,9 +1450,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKilobyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsKilobyte(final @NotNull BigInteger numberOfBytes) { return formatAsKilobyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -1590,9 +1460,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKilobyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsKilobyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsKilobyte(numberOfBytes.longValue(), pattern); } @@ -1601,9 +1470,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKilobyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsKilobyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsKilobyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -1612,9 +1480,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKilobyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsKilobyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsKilobyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -1624,12 +1491,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKilobyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsKilobyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsKilobyte(numberOfBytes.longValue(), pattern, locale); } @@ -1639,12 +1505,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKilobyte( + public static @NotNull String formatAsKilobyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsKilobyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -1654,12 +1519,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKilobyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsKilobyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsKilobyte(numberOfBytes, asFormat(pattern, locale)); } @@ -1668,9 +1532,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKilobyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsKilobyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsKilobyte(numberOfBytes.longValue(), format); } @@ -1679,9 +1542,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKilobyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsKilobyte(final long numberOfBytes, final @NotNull Format format) { return formatAsKilobyte(BigInteger.valueOf(numberOfBytes), format); } @@ -1690,9 +1552,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsKilobyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsKilobyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Kilobyte.valueOf(numberOfBytes).toString(format); } @@ -1700,9 +1561,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMegabyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsMegabyte(final @NotNull Long numberOfBytes) { return formatAsMegabyte(numberOfBytes.longValue()); } @@ -1710,9 +1570,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMegabyte(final long numberOfBytes) { + public static @NotNull String formatAsMegabyte(final long numberOfBytes) { return formatAsMegabyte(BigInteger.valueOf(numberOfBytes)); } @@ -1720,9 +1579,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMegabyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsMegabyte(final @NotNull BigInteger numberOfBytes) { return formatAsMegabyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -1731,9 +1589,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMegabyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsMegabyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsMegabyte(numberOfBytes.longValue(), pattern); } @@ -1742,9 +1599,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMegabyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsMegabyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsMegabyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -1753,9 +1609,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMegabyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsMegabyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsMegabyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -1765,12 +1620,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMegabyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsMegabyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsMegabyte(numberOfBytes.longValue(), pattern, locale); } @@ -1780,12 +1634,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMegabyte( + public static @NotNull String formatAsMegabyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsMegabyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -1795,12 +1648,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMegabyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsMegabyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsMegabyte(numberOfBytes, asFormat(pattern, locale)); } @@ -1809,9 +1661,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMegabyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsMegabyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsMegabyte(numberOfBytes.longValue(), format); } @@ -1820,9 +1671,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMegabyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsMegabyte(final long numberOfBytes, final @NotNull Format format) { return formatAsMegabyte(BigInteger.valueOf(numberOfBytes), format); } @@ -1831,9 +1681,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsMegabyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsMegabyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Megabyte.valueOf(numberOfBytes).toString(format); } @@ -1841,9 +1690,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGigabyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsGigabyte(final @NotNull Long numberOfBytes) { return formatAsGigabyte(numberOfBytes.longValue()); } @@ -1851,9 +1699,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGigabyte(final long numberOfBytes) { + public static @NotNull String formatAsGigabyte(final long numberOfBytes) { return formatAsGigabyte(BigInteger.valueOf(numberOfBytes)); } @@ -1861,9 +1708,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGigabyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsGigabyte(final @NotNull BigInteger numberOfBytes) { return formatAsGigabyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -1872,9 +1718,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGigabyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsGigabyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsGigabyte(numberOfBytes.longValue(), pattern); } @@ -1883,9 +1728,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGigabyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsGigabyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsGigabyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -1894,9 +1738,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGigabyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsGigabyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsGigabyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -1906,12 +1749,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGigabyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsGigabyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsGigabyte(numberOfBytes.longValue(), pattern, locale); } @@ -1921,12 +1763,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGigabyte( + public static @NotNull String formatAsGigabyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsGigabyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -1936,12 +1777,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGigabyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsGigabyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsGigabyte(numberOfBytes, asFormat(pattern, locale)); } @@ -1950,9 +1790,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGigabyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsGigabyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsGigabyte(numberOfBytes.longValue(), format); } @@ -1961,9 +1800,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGigabyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsGigabyte(final long numberOfBytes, final @NotNull Format format) { return formatAsGigabyte(BigInteger.valueOf(numberOfBytes), format); } @@ -1972,9 +1810,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsGigabyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsGigabyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Gigabyte.valueOf(numberOfBytes).toString(format); } @@ -1982,9 +1819,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTerabyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsTerabyte(final @NotNull Long numberOfBytes) { return formatAsTerabyte(numberOfBytes.longValue()); } @@ -1992,9 +1828,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTerabyte(final long numberOfBytes) { + public static @NotNull String formatAsTerabyte(final long numberOfBytes) { return formatAsTerabyte(BigInteger.valueOf(numberOfBytes)); } @@ -2002,9 +1837,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTerabyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsTerabyte(final @NotNull BigInteger numberOfBytes) { return formatAsTerabyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -2013,9 +1847,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTerabyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsTerabyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsTerabyte(numberOfBytes.longValue(), pattern); } @@ -2024,9 +1857,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTerabyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsTerabyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsTerabyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -2035,9 +1867,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTerabyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsTerabyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsTerabyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -2047,12 +1878,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTerabyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsTerabyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsTerabyte(numberOfBytes.longValue(), pattern, locale); } @@ -2062,12 +1892,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTerabyte( + public static @NotNull String formatAsTerabyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsTerabyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -2077,12 +1906,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTerabyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsTerabyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsTerabyte(numberOfBytes, asFormat(pattern, locale)); } @@ -2091,9 +1919,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTerabyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsTerabyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsTerabyte(numberOfBytes.longValue(), format); } @@ -2102,9 +1929,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTerabyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsTerabyte(final long numberOfBytes, final @NotNull Format format) { return formatAsTerabyte(BigInteger.valueOf(numberOfBytes), format); } @@ -2113,9 +1939,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsTerabyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsTerabyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Terabyte.valueOf(numberOfBytes).toString(format); } @@ -2123,9 +1948,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPetabyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsPetabyte(final @NotNull Long numberOfBytes) { return formatAsPetabyte(numberOfBytes.longValue()); } @@ -2133,9 +1957,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPetabyte(final long numberOfBytes) { + public static @NotNull String formatAsPetabyte(final long numberOfBytes) { return formatAsPetabyte(BigInteger.valueOf(numberOfBytes)); } @@ -2143,9 +1966,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPetabyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsPetabyte(final @NotNull BigInteger numberOfBytes) { return formatAsPetabyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -2154,9 +1976,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPetabyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsPetabyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsPetabyte(numberOfBytes.longValue(), pattern); } @@ -2165,9 +1986,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPetabyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsPetabyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsPetabyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -2176,9 +1996,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPetabyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsPetabyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsPetabyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -2188,12 +2007,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPetabyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsPetabyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsPetabyte(numberOfBytes.longValue(), pattern, locale); } @@ -2203,12 +2021,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPetabyte( + public static @NotNull String formatAsPetabyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsPetabyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -2218,12 +2035,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPetabyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsPetabyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsPetabyte(numberOfBytes, asFormat(pattern, locale)); } @@ -2232,9 +2048,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPetabyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsPetabyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsPetabyte(numberOfBytes.longValue(), format); } @@ -2243,9 +2058,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPetabyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsPetabyte(final long numberOfBytes, final @NotNull Format format) { return formatAsPetabyte(BigInteger.valueOf(numberOfBytes), format); } @@ -2254,9 +2068,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsPetabyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsPetabyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Petabyte.valueOf(numberOfBytes).toString(format); } @@ -2264,9 +2077,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExabyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsExabyte(final @NotNull Long numberOfBytes) { return formatAsExabyte(numberOfBytes.longValue()); } @@ -2274,9 +2086,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExabyte(final long numberOfBytes) { + public static @NotNull String formatAsExabyte(final long numberOfBytes) { return formatAsExabyte(BigInteger.valueOf(numberOfBytes)); } @@ -2284,9 +2095,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExabyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsExabyte(final @NotNull BigInteger numberOfBytes) { return formatAsExabyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -2295,9 +2105,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExabyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsExabyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsExabyte(numberOfBytes.longValue(), pattern); } @@ -2306,9 +2115,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExabyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsExabyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsExabyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -2317,9 +2125,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExabyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsExabyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsExabyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -2329,12 +2136,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExabyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsExabyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsExabyte(numberOfBytes.longValue(), pattern, locale); } @@ -2344,12 +2150,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExabyte( + public static @NotNull String formatAsExabyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsExabyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -2359,12 +2164,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExabyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsExabyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsExabyte(numberOfBytes, asFormat(pattern, locale)); } @@ -2373,9 +2177,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExabyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsExabyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsExabyte(numberOfBytes.longValue(), format); } @@ -2384,9 +2187,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExabyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsExabyte(final long numberOfBytes, final @NotNull Format format) { return formatAsExabyte(BigInteger.valueOf(numberOfBytes), format); } @@ -2395,9 +2197,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsExabyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsExabyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Exabyte.valueOf(numberOfBytes).toString(format); } @@ -2405,9 +2206,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZettabyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsZettabyte(final @NotNull Long numberOfBytes) { return formatAsZettabyte(numberOfBytes.longValue()); } @@ -2415,9 +2215,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZettabyte(final long numberOfBytes) { + public static @NotNull String formatAsZettabyte(final long numberOfBytes) { return formatAsZettabyte(BigInteger.valueOf(numberOfBytes)); } @@ -2425,9 +2224,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZettabyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsZettabyte(final @NotNull BigInteger numberOfBytes) { return formatAsZettabyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -2436,9 +2234,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZettabyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsZettabyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsZettabyte(numberOfBytes.longValue(), pattern); } @@ -2447,9 +2244,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZettabyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsZettabyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsZettabyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -2458,9 +2254,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZettabyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsZettabyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsZettabyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -2470,12 +2265,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZettabyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsZettabyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsZettabyte(numberOfBytes.longValue(), pattern, locale); } @@ -2485,12 +2279,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZettabyte( + public static @NotNull String formatAsZettabyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsZettabyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -2500,12 +2293,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZettabyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsZettabyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsZettabyte(numberOfBytes, asFormat(pattern, locale)); } @@ -2514,9 +2306,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZettabyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsZettabyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsZettabyte(numberOfBytes.longValue(), format); } @@ -2525,9 +2316,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZettabyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsZettabyte(final long numberOfBytes, final @NotNull Format format) { return formatAsZettabyte(BigInteger.valueOf(numberOfBytes), format); } @@ -2536,9 +2326,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsZettabyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsZettabyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Zettabyte.valueOf(numberOfBytes).toString(format); } @@ -2546,9 +2335,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYottabyte(@NotNull final Long numberOfBytes) { + public static @NotNull String formatAsYottabyte(final @NotNull Long numberOfBytes) { return formatAsYottabyte(numberOfBytes.longValue()); } @@ -2556,9 +2344,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYottabyte(final long numberOfBytes) { + public static @NotNull String formatAsYottabyte(final long numberOfBytes) { return formatAsYottabyte(BigInteger.valueOf(numberOfBytes)); } @@ -2566,9 +2353,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to format. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYottabyte(@NotNull final BigInteger numberOfBytes) { + public static @NotNull String formatAsYottabyte(final @NotNull BigInteger numberOfBytes) { return formatAsYottabyte(numberOfBytes, StorageUnit.DEFAULT_FORMAT_PATTERN); } @@ -2577,9 +2363,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYottabyte(@NotNull final Long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsYottabyte(final @NotNull Long numberOfBytes, final @NotNull String pattern) { return formatAsYottabyte(numberOfBytes.longValue(), pattern); } @@ -2588,9 +2373,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYottabyte(final long numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsYottabyte(final long numberOfBytes, final @NotNull String pattern) { return formatAsYottabyte(BigInteger.valueOf(numberOfBytes), pattern); } @@ -2600,12 +2384,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYottabyte( - @NotNull final BigInteger numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsYottabyte( + final @NotNull BigInteger numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsYottabyte(numberOfBytes, asFormat(pattern, locale)); } @@ -2615,12 +2398,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYottabyte( - @NotNull final Long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + public static @NotNull String formatAsYottabyte( + final @NotNull Long numberOfBytes, + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsYottabyte(numberOfBytes.longValue(), pattern, locale); } @@ -2630,12 +2412,11 @@ public final class StorageUnits { * @param locale The locale to use. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYottabyte( + public static @NotNull String formatAsYottabyte( final long numberOfBytes, - @NotNull final String pattern, - @NotNull final Locale locale) { + final @NotNull String pattern, + final @NotNull Locale locale) { return formatAsYottabyte(BigInteger.valueOf(numberOfBytes), pattern, locale); } @@ -2644,9 +2425,8 @@ public final class StorageUnits { * @param pattern The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYottabyte(@NotNull final BigInteger numberOfBytes, @NotNull final String pattern) { + public static @NotNull String formatAsYottabyte(final @NotNull BigInteger numberOfBytes, final @NotNull String pattern) { return formatAsYottabyte(numberOfBytes, new DecimalFormat(pattern)); } @@ -2655,9 +2435,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYottabyte(@NotNull final Long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsYottabyte(final @NotNull Long numberOfBytes, final @NotNull Format format) { return formatAsYottabyte(numberOfBytes.longValue(), format); } @@ -2666,9 +2445,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYottabyte(final long numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsYottabyte(final long numberOfBytes, final @NotNull Format format) { return formatAsYottabyte(BigInteger.valueOf(numberOfBytes), format); } @@ -2677,9 +2455,8 @@ public final class StorageUnits { * @param format The formatting pattern to apply. * @return The formatted bytes using the default pattern. */ - @NotNull @CheckReturnValue - public static String formatAsYottabyte(@NotNull final BigInteger numberOfBytes, @NotNull final Format format) { + public static @NotNull String formatAsYottabyte(final @NotNull BigInteger numberOfBytes, final @NotNull Format format) { return Yottabyte.valueOf(numberOfBytes).toString(format); } @@ -2687,9 +2464,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to create. * @return A new unit representing the given amount of bytes. */ - @NotNull @CheckReturnValue - public static Byte bytes(@NotNull final Long numberOfBytes) { + public static @NotNull Byte bytes(final @NotNull Long numberOfBytes) { return bytes(numberOfBytes.longValue()); } @@ -2697,9 +2473,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to create. * @return A new unit representing the given amount of bytes. */ - @NotNull @CheckReturnValue - public static Byte bytes(final long numberOfBytes) { + public static @NotNull Byte bytes(final long numberOfBytes) { return bytes(BigInteger.valueOf(numberOfBytes)); } @@ -2707,9 +2482,8 @@ public final class StorageUnits { * @param numberOfBytes The amount of bytes to create. * @return A new unit representing the given amount of bytes. */ - @NotNull @CheckReturnValue - public static Byte bytes(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Byte bytes(final @NotNull BigInteger numberOfBytes) { return new Byte(numberOfBytes); } @@ -2717,9 +2491,8 @@ public final class StorageUnits { * @param numberOfKibibytes The amount of kibibytes to create. * @return A new unit representing the given amount of kibibytes. */ - @NotNull @CheckReturnValue - public static Kibibyte kibibyte(@NotNull final Long numberOfKibibytes) { + public static @NotNull Kibibyte kibibyte(final @NotNull Long numberOfKibibytes) { return kibibyte(numberOfKibibytes.longValue()); } @@ -2727,9 +2500,8 @@ public final class StorageUnits { * @param numberOfKibibytes The amount of kibibytes to create. * @return A new unit representing the given amount of kibibytes. */ - @NotNull @CheckReturnValue - public static Kibibyte kibibyte(final long numberOfKibibytes) { + public static @NotNull Kibibyte kibibyte(final long numberOfKibibytes) { return kibibyte(BigInteger.valueOf(numberOfKibibytes)); } @@ -2737,9 +2509,8 @@ public final class StorageUnits { * @param numberOfKibibytes The amount of kibibytes to create. * @return A new unit representing the given amount of kibibytes. */ - @NotNull @CheckReturnValue - public static Kibibyte kibibyte(@NotNull final BigInteger numberOfKibibytes) { + public static @NotNull Kibibyte kibibyte(final @NotNull BigInteger numberOfKibibytes) { return new Kibibyte(StorageUnit.BYTES_IN_A_KIBIBYTE.multiply(numberOfKibibytes)); } @@ -2747,9 +2518,8 @@ public final class StorageUnits { * @param numberOfMebibytes The amount of mebibytes to create. * @return A new unit representing the given amount of mebibytes. */ - @NotNull @CheckReturnValue - public static Mebibyte mebibyte(@NotNull final Long numberOfMebibytes) { + public static @NotNull Mebibyte mebibyte(final @NotNull Long numberOfMebibytes) { return mebibyte(numberOfMebibytes.longValue()); } @@ -2757,9 +2527,8 @@ public final class StorageUnits { * @param numberOfMebibytes The amount of mebibytes to create. * @return A new unit representing the given amount of mebibytes. */ - @NotNull @CheckReturnValue - public static Mebibyte mebibyte(final long numberOfMebibytes) { + public static @NotNull Mebibyte mebibyte(final long numberOfMebibytes) { return mebibyte(BigInteger.valueOf(numberOfMebibytes)); } @@ -2767,9 +2536,8 @@ public final class StorageUnits { * @param numberOfMebibytes The amount of mebibytes to create. * @return A new unit representing the given amount of mebibytes. */ - @NotNull @CheckReturnValue - public static Mebibyte mebibyte(@NotNull final BigInteger numberOfMebibytes) { + public static @NotNull Mebibyte mebibyte(final @NotNull BigInteger numberOfMebibytes) { return new Mebibyte(StorageUnit.BYTES_IN_A_MEBIBYTE.multiply(numberOfMebibytes)); } @@ -2777,9 +2545,8 @@ public final class StorageUnits { * @param numberOfGibibytes The amount of gibibytes to create. * @return A new unit representing the given amount of gibibytes. */ - @NotNull @CheckReturnValue - public static Gibibyte gibibyte(@NotNull final Long numberOfGibibytes) { + public static @NotNull Gibibyte gibibyte(final @NotNull Long numberOfGibibytes) { return gibibyte(numberOfGibibytes.longValue()); } @@ -2787,9 +2554,8 @@ public final class StorageUnits { * @param numberOfGibibytes The amount of gibibytes to create. * @return A new unit representing the given amount of gibibytes. */ - @NotNull @CheckReturnValue - public static Gibibyte gibibyte(final long numberOfGibibytes) { + public static @NotNull Gibibyte gibibyte(final long numberOfGibibytes) { return gibibyte(BigInteger.valueOf(numberOfGibibytes)); } @@ -2797,9 +2563,8 @@ public final class StorageUnits { * @param numberOfGibibytes The amount of gibibytes to create. * @return A new unit representing the given amount of gibibytes. */ - @NotNull @CheckReturnValue - public static Gibibyte gibibyte(@NotNull final BigInteger numberOfGibibytes) { + public static @NotNull Gibibyte gibibyte(final @NotNull BigInteger numberOfGibibytes) { return new Gibibyte(StorageUnit.BYTES_IN_A_GIBIBYTE.multiply(numberOfGibibytes)); } @@ -2807,9 +2572,8 @@ public final class StorageUnits { * @param numberOfTebibytes The amount of tebibytes to create. * @return A new unit representing the given amount of tebibytes. */ - @NotNull @CheckReturnValue - public static Tebibyte tebibyte(@NotNull final Long numberOfTebibytes) { + public static @NotNull Tebibyte tebibyte(final @NotNull Long numberOfTebibytes) { return tebibyte(numberOfTebibytes.longValue()); } @@ -2817,9 +2581,8 @@ public final class StorageUnits { * @param numberOfTebibytes The amount of tebibytes to create. * @return A new unit representing the given amount of tebibytes. */ - @NotNull @CheckReturnValue - public static Tebibyte tebibyte(final long numberOfTebibytes) { + public static @NotNull Tebibyte tebibyte(final long numberOfTebibytes) { return tebibyte(BigInteger.valueOf(numberOfTebibytes)); } @@ -2827,9 +2590,8 @@ public final class StorageUnits { * @param numberOfTebibytes The amount of tebibytes to create. * @return A new unit representing the given amount of tebibytes. */ - @NotNull @CheckReturnValue - public static Tebibyte tebibyte(@NotNull final BigInteger numberOfTebibytes) { + public static @NotNull Tebibyte tebibyte(final @NotNull BigInteger numberOfTebibytes) { return new Tebibyte(StorageUnit.BYTES_IN_A_TEBIBYTE.multiply(numberOfTebibytes)); } @@ -2837,9 +2599,8 @@ public final class StorageUnits { * @param numberOfPebibytes The amount of pebibytes to create. * @return A new unit representing the given amount of pebibytes. */ - @NotNull @CheckReturnValue - public static Pebibyte pebibyte(@NotNull final Long numberOfPebibytes) { + public static @NotNull Pebibyte pebibyte(final @NotNull Long numberOfPebibytes) { return pebibyte(numberOfPebibytes.longValue()); } @@ -2847,9 +2608,8 @@ public final class StorageUnits { * @param numberOfPebibytes The amount of pebibytes to create. * @return A new unit representing the given amount of pebibytes. */ - @NotNull @CheckReturnValue - public static Pebibyte pebibyte(final long numberOfPebibytes) { + public static @NotNull Pebibyte pebibyte(final long numberOfPebibytes) { return pebibyte(BigInteger.valueOf(numberOfPebibytes)); } @@ -2857,9 +2617,8 @@ public final class StorageUnits { * @param numberOfPebibytes The amount of pebibytes to create. * @return A new unit representing the given amount of pebibytes. */ - @NotNull @CheckReturnValue - public static Pebibyte pebibyte(@NotNull final BigInteger numberOfPebibytes) { + public static @NotNull Pebibyte pebibyte(final @NotNull BigInteger numberOfPebibytes) { return new Pebibyte(StorageUnit.BYTES_IN_A_PEBIBYTE.multiply(numberOfPebibytes)); } @@ -2867,9 +2626,8 @@ public final class StorageUnits { * @param numberOfExbibytes The amount of exbibytes to create. * @return A new unit representing the given amount of exbibytes. */ - @NotNull @CheckReturnValue - public static Exbibyte exbibyte(@NotNull final Long numberOfExbibytes) { + public static @NotNull Exbibyte exbibyte(final @NotNull Long numberOfExbibytes) { return exbibyte(numberOfExbibytes.longValue()); } @@ -2877,9 +2635,8 @@ public final class StorageUnits { * @param numberOfExbibytes The amount of exbibytes to create. * @return A new unit representing the given amount of exbibytes. */ - @NotNull @CheckReturnValue - public static Exbibyte exbibyte(final long numberOfExbibytes) { + public static @NotNull Exbibyte exbibyte(final long numberOfExbibytes) { return exbibyte(BigInteger.valueOf(numberOfExbibytes)); } @@ -2887,9 +2644,8 @@ public final class StorageUnits { * @param numberOfExbibytes The amount of exbibytes to create. * @return A new unit representing the given amount of exbibytes. */ - @NotNull @CheckReturnValue - public static Exbibyte exbibyte(@NotNull final BigInteger numberOfExbibytes) { + public static @NotNull Exbibyte exbibyte(final @NotNull BigInteger numberOfExbibytes) { return new Exbibyte(StorageUnit.BYTES_IN_A_EXBIBYTE.multiply(numberOfExbibytes)); } @@ -2897,9 +2653,8 @@ public final class StorageUnits { * @param numberOfZebibytes The amount of zebibytes to create. * @return A new unit representing the given amount of zebibytes. */ - @NotNull @CheckReturnValue - public static Zebibyte zebibyte(@NotNull final Long numberOfZebibytes) { + public static @NotNull Zebibyte zebibyte(final @NotNull Long numberOfZebibytes) { return zebibyte(numberOfZebibytes.longValue()); } @@ -2907,9 +2662,8 @@ public final class StorageUnits { * @param numberOfZebibytes The amount of zebibytes to create. * @return A new unit representing the given amount of zebibytes. */ - @NotNull @CheckReturnValue - public static Zebibyte zebibyte(final long numberOfZebibytes) { + public static @NotNull Zebibyte zebibyte(final long numberOfZebibytes) { return zebibyte(BigInteger.valueOf(numberOfZebibytes)); } @@ -2917,9 +2671,8 @@ public final class StorageUnits { * @param numberOfZebibytes The amount of zebibytes to create. * @return A new unit representing the given amount of zebibytes. */ - @NotNull @CheckReturnValue - public static Zebibyte zebibyte(@NotNull final BigInteger numberOfZebibytes) { + public static @NotNull Zebibyte zebibyte(final @NotNull BigInteger numberOfZebibytes) { return new Zebibyte(StorageUnit.BYTES_IN_A_ZEBIBYTE.multiply(numberOfZebibytes)); } @@ -2927,9 +2680,8 @@ public final class StorageUnits { * @param numberOfYobibytes The amount of yobibytes to create. * @return A new unit representing the given amount of yobibytes. */ - @NotNull @CheckReturnValue - public static Yobibyte yobibyte(@NotNull final Long numberOfYobibytes) { + public static @NotNull Yobibyte yobibyte(final @NotNull Long numberOfYobibytes) { return yobibyte(numberOfYobibytes.longValue()); } @@ -2937,9 +2689,8 @@ public final class StorageUnits { * @param numberOfYobibytes The amount of yobibytes to create. * @return A new unit representing the given amount of yobibytes. */ - @NotNull @CheckReturnValue - public static Yobibyte yobibyte(final long numberOfYobibytes) { + public static @NotNull Yobibyte yobibyte(final long numberOfYobibytes) { return yobibyte(BigInteger.valueOf(numberOfYobibytes)); } @@ -2947,9 +2698,8 @@ public final class StorageUnits { * @param numberOfYobibytes The amount of yobibytes to create. * @return A new unit representing the given amount of yobibytes. */ - @NotNull @CheckReturnValue - public static Yobibyte yobibyte(@NotNull final BigInteger numberOfYobibytes) { + public static @NotNull Yobibyte yobibyte(final @NotNull BigInteger numberOfYobibytes) { return new Yobibyte(StorageUnit.BYTES_IN_A_YOBIBYTE.multiply(numberOfYobibytes)); } @@ -2957,9 +2707,8 @@ public final class StorageUnits { * @param numberOfKilobytes The number of kilobytes to create. * @return A new unit representing the given amount of kilobytes. */ - @NotNull @CheckReturnValue - public static Kilobyte kilobyte(@NotNull final Long numberOfKilobytes) { + public static @NotNull Kilobyte kilobyte(final @NotNull Long numberOfKilobytes) { return kilobyte(numberOfKilobytes.longValue()); } @@ -2967,9 +2716,8 @@ public final class StorageUnits { * @param numberOfKilobytes The number of kilobytes to create. * @return A new unit representing the given amount of kilobytes. */ - @NotNull @CheckReturnValue - public static Kilobyte kilobyte(final long numberOfKilobytes) { + public static @NotNull Kilobyte kilobyte(final long numberOfKilobytes) { return kilobyte(BigInteger.valueOf(numberOfKilobytes)); } @@ -2977,9 +2725,8 @@ public final class StorageUnits { * @param numberOfKilobytes The number of kilobytes to create. * @return A new unit representing the given amount of kilobytes. */ - @NotNull @CheckReturnValue - public static Kilobyte kilobyte(@NotNull final BigInteger numberOfKilobytes) { + public static @NotNull Kilobyte kilobyte(final @NotNull BigInteger numberOfKilobytes) { return new Kilobyte(StorageUnit.BYTES_IN_A_KILOBYTE.multiply(numberOfKilobytes)); } @@ -2987,9 +2734,8 @@ public final class StorageUnits { * @param numberOfMegabytes The number of megabytes to create. * @return A new unit representing the given amount of megabytes. */ - @NotNull @CheckReturnValue - public static Megabyte megabyte(@NotNull final Long numberOfMegabytes) { + public static @NotNull Megabyte megabyte(final @NotNull Long numberOfMegabytes) { return megabyte(numberOfMegabytes.longValue()); } @@ -2997,9 +2743,8 @@ public final class StorageUnits { * @param numberOfMegabytes The number of megabytes to create. * @return A new unit representing the given amount of megabytes. */ - @NotNull @CheckReturnValue - public static Megabyte megabyte(final long numberOfMegabytes) { + public static @NotNull Megabyte megabyte(final long numberOfMegabytes) { return megabyte(BigInteger.valueOf(numberOfMegabytes)); } @@ -3007,9 +2752,8 @@ public final class StorageUnits { * @param numberOfMegabytes The number of megabytes to create. * @return A new unit representing the given amount of megabytes. */ - @NotNull @CheckReturnValue - public static Megabyte megabyte(@NotNull final BigInteger numberOfMegabytes) { + public static @NotNull Megabyte megabyte(final @NotNull BigInteger numberOfMegabytes) { return new Megabyte(StorageUnit.BYTES_IN_A_MEGABYTE.multiply(numberOfMegabytes)); } @@ -3017,9 +2761,8 @@ public final class StorageUnits { * @param numberOfGigabytes The number of gigabytes to create. * @return A new unit representing the given amount of gigabytes. */ - @NotNull @CheckReturnValue - public static Gigabyte gigabyte(@NotNull final Long numberOfGigabytes) { + public static @NotNull Gigabyte gigabyte(final @NotNull Long numberOfGigabytes) { return gigabyte(numberOfGigabytes.longValue()); } @@ -3027,9 +2770,8 @@ public final class StorageUnits { * @param numberOfGigabytes The number of gigabytes to create. * @return A new unit representing the given amount of gigabytes. */ - @NotNull @CheckReturnValue - public static Gigabyte gigabyte(final long numberOfGigabytes) { + public static @NotNull Gigabyte gigabyte(final long numberOfGigabytes) { return gigabyte(BigInteger.valueOf(numberOfGigabytes)); } @@ -3037,9 +2779,8 @@ public final class StorageUnits { * @param numberOfGigabytes The number of gigabytes to create. * @return A new unit representing the given amount of gigabytes. */ - @NotNull @CheckReturnValue - public static Gigabyte gigabyte(@NotNull final BigInteger numberOfGigabytes) { + public static @NotNull Gigabyte gigabyte(final @NotNull BigInteger numberOfGigabytes) { return new Gigabyte(StorageUnit.BYTES_IN_A_GIGABYTE.multiply(numberOfGigabytes)); } @@ -3047,9 +2788,8 @@ public final class StorageUnits { * @param numberOfTerabytes The number of terabytes to create. * @return A new unit representing the given amount of terabytes. */ - @NotNull @CheckReturnValue - public static Terabyte terabyte(@NotNull final Long numberOfTerabytes) { + public static @NotNull Terabyte terabyte(final @NotNull Long numberOfTerabytes) { return terabyte(numberOfTerabytes.longValue()); } @@ -3057,9 +2797,8 @@ public final class StorageUnits { * @param numberOfTerabytes The number of terabytes to create. * @return A new unit representing the given amount of terabytes. */ - @NotNull @CheckReturnValue - public static Terabyte terabyte(final long numberOfTerabytes) { + public static @NotNull Terabyte terabyte(final long numberOfTerabytes) { return terabyte(BigInteger.valueOf(numberOfTerabytes)); } @@ -3067,9 +2806,8 @@ public final class StorageUnits { * @param numberOfTerabytes The number of terabytes to create. * @return A new unit representing the given amount of terabytes. */ - @NotNull @CheckReturnValue - public static Terabyte terabyte(@NotNull final BigInteger numberOfTerabytes) { + public static @NotNull Terabyte terabyte(final @NotNull BigInteger numberOfTerabytes) { return new Terabyte(StorageUnit.BYTES_IN_A_TERABYTE.multiply(numberOfTerabytes)); } @@ -3077,9 +2815,8 @@ public final class StorageUnits { * @param numberOfPetabytes The number of petabytes to create. * @return A new unit representing the given amount of petabytes. */ - @NotNull @CheckReturnValue - public static Petabyte petabyte(@NotNull final Long numberOfPetabytes) { + public static @NotNull Petabyte petabyte(final @NotNull Long numberOfPetabytes) { return petabyte(numberOfPetabytes.longValue()); } @@ -3087,9 +2824,8 @@ public final class StorageUnits { * @param numberOfPetabytes The number of petabytes to create. * @return A new unit representing the given amount of petabytes. */ - @NotNull @CheckReturnValue - public static Petabyte petabyte(final long numberOfPetabytes) { + public static @NotNull Petabyte petabyte(final long numberOfPetabytes) { return petabyte(BigInteger.valueOf(numberOfPetabytes)); } @@ -3097,9 +2833,8 @@ public final class StorageUnits { * @param numberOfPetabytes The number of petabytes to create. * @return A new unit representing the given amount of petabytes. */ - @NotNull @CheckReturnValue - public static Petabyte petabyte(@NotNull final BigInteger numberOfPetabytes) { + public static @NotNull Petabyte petabyte(final @NotNull BigInteger numberOfPetabytes) { return new Petabyte(StorageUnit.BYTES_IN_A_PETABYTE.multiply(numberOfPetabytes)); } @@ -3107,9 +2842,8 @@ public final class StorageUnits { * @param numberOfExabytes The number of exabytes to create. * @return A new unit representing the given amount of exabytes. */ - @NotNull @CheckReturnValue - public static Exabyte exabyte(@NotNull final Long numberOfExabytes) { + public static @NotNull Exabyte exabyte(final @NotNull Long numberOfExabytes) { return exabyte(numberOfExabytes.longValue()); } @@ -3117,9 +2851,8 @@ public final class StorageUnits { * @param numberOfExabytes The number of exabytes to create. * @return A new unit representing the given amount of exabytes. */ - @NotNull @CheckReturnValue - public static Exabyte exabyte(final long numberOfExabytes) { + public static @NotNull Exabyte exabyte(final long numberOfExabytes) { return exabyte(BigInteger.valueOf(numberOfExabytes)); } @@ -3127,9 +2860,8 @@ public final class StorageUnits { * @param numberOfExabytes The number of exabytes to create. * @return A new unit representing the given amount of exabytes. */ - @NotNull @CheckReturnValue - public static Exabyte exabyte(@NotNull final BigInteger numberOfExabytes) { + public static @NotNull Exabyte exabyte(final @NotNull BigInteger numberOfExabytes) { return new Exabyte(StorageUnit.BYTES_IN_A_EXABYTE.multiply(numberOfExabytes)); } @@ -3137,9 +2869,8 @@ public final class StorageUnits { * @param numberOfZettabytes The number of zettabytes to create. * @return A new unit representing the given amount of zettabytes. */ - @NotNull @CheckReturnValue - public static Zettabyte zettabyte(@NotNull final Long numberOfZettabytes) { + public static @NotNull Zettabyte zettabyte(final @NotNull Long numberOfZettabytes) { return zettabyte(numberOfZettabytes.longValue()); } @@ -3147,9 +2878,8 @@ public final class StorageUnits { * @param numberOfZettabytes The number of zettabytes to create. * @return A new unit representing the given amount of zettabytes. */ - @NotNull @CheckReturnValue - public static Zettabyte zettabyte(final long numberOfZettabytes) { + public static @NotNull Zettabyte zettabyte(final long numberOfZettabytes) { return zettabyte(BigInteger.valueOf(numberOfZettabytes)); } @@ -3157,9 +2887,8 @@ public final class StorageUnits { * @param numberOfZettabytes The number of zettabytes to create. * @return A new unit representing the given amount of zettabytes. */ - @NotNull @CheckReturnValue - public static Zettabyte zettabyte(@NotNull final BigInteger numberOfZettabytes) { + public static @NotNull Zettabyte zettabyte(final @NotNull BigInteger numberOfZettabytes) { return new Zettabyte(StorageUnit.BYTES_IN_A_ZETTABYTE.multiply(numberOfZettabytes)); } @@ -3167,9 +2896,8 @@ public final class StorageUnits { * @param numberOfYottabytes The number of yottabytes to create. * @return A new unit representing the given amount of yottabytes. */ - @NotNull @CheckReturnValue - public static Yottabyte yottabyte(@NotNull final Long numberOfYottabytes) { + public static @NotNull Yottabyte yottabyte(final @NotNull Long numberOfYottabytes) { return yottabyte(numberOfYottabytes.longValue()); } @@ -3177,9 +2905,8 @@ public final class StorageUnits { * @param numberOfYottabytes The number of yottabytes to create. * @return A new unit representing the given amount of yottabytes. */ - @NotNull @CheckReturnValue - public static Yottabyte yottabyte(final long numberOfYottabytes) { + public static @NotNull Yottabyte yottabyte(final long numberOfYottabytes) { return yottabyte(BigInteger.valueOf(numberOfYottabytes)); } @@ -3187,9 +2914,8 @@ public final class StorageUnits { * @param numberOfYottabytes The number of yottabytes to create. * @return A new unit representing the given amount of yottabytes. */ - @NotNull @CheckReturnValue - public static Yottabyte yottabyte(@NotNull final BigInteger numberOfYottabytes) { + public static @NotNull Yottabyte yottabyte(final @NotNull BigInteger numberOfYottabytes) { return new Yottabyte(StorageUnit.BYTES_IN_A_YOTTABYTE.multiply(numberOfYottabytes)); } 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 db1592a..409d5ec 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 @@ -19,7 +19,7 @@ public final class Tebibyte extends StorageUnit { @Serial private static final long serialVersionUID = 3614537130129620881L; - Tebibyte(@NotNull final BigInteger bytes) { + Tebibyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Tebibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Tebibyte contains. * @return A new Tebibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Tebibyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Tebibyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Tebibyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Tebibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Tebibyte contains. * @return A new Tebibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Tebibyte valueOf(final long numberOfBytes) { + public static @NotNull Tebibyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Tebibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Tebibyte contains. * @return A new Tebibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Tebibyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Tebibyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Tebibyte add(final long bytesToAdd) { + public @NotNull Tebibyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Tebibyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Tebibyte add(final @NotNull BigInteger bytesToAdd) { return new Tebibyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Tebibyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Tebibyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Tebibyte divide(final long divisor) { + public @NotNull Tebibyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Tebibyte divide(@NotNull final BigInteger divisor) { + public @NotNull Tebibyte divide(final @NotNull BigInteger divisor) { return new Tebibyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Tebibyte multiply(final long factor) { + public @NotNull Tebibyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Tebibyte multiply(@NotNull final BigInteger factor) { + public @NotNull Tebibyte multiply(final @NotNull BigInteger factor) { return new Tebibyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Tebibyte subtract(final long bytesToSubtract) { + public @NotNull Tebibyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Tebibyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Tebibyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Tebibyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Tebibyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Tebibyte subtract(final @NotNull StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return BYTES_IN_A_TEBIBYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "TiB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::binaryValueOf; } 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 2a1fdac..527b6fe 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 @@ -19,7 +19,7 @@ public final class Terabyte extends StorageUnit { @Serial private static final long serialVersionUID = 2160488069631638952L; - Terabyte(@NotNull final BigInteger bytes) { + Terabyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Terabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Terabyte contains. * @return A new Kilobyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Terabyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Terabyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Terabyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Terabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Terabyte contains. * @return A new Terabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Terabyte valueOf(final long numberOfBytes) { + public static @NotNull Terabyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Terabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Terabyte contains. * @return A new Terabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Terabyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Terabyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Terabyte add(final long bytesToAdd) { + public @NotNull Terabyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Terabyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Terabyte add(final @NotNull BigInteger bytesToAdd) { return new Terabyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Terabyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Terabyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Terabyte divide(final long divisor) { + public @NotNull Terabyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Terabyte divide(@NotNull final BigInteger divisor) { + public @NotNull Terabyte divide(final @NotNull BigInteger divisor) { return new Terabyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Terabyte multiply(final long factor) { + public @NotNull Terabyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Terabyte multiply(@NotNull final BigInteger factor) { + public @NotNull Terabyte multiply(final @NotNull BigInteger factor) { return new Terabyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Terabyte subtract(final long bytesToSubtract) { + public @NotNull Terabyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Terabyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Terabyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Terabyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Terabyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Terabyte subtract(final @NotNull StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return StorageUnit.BYTES_IN_A_TERABYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "TB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::decimalValueOf; } 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 4cac2fd..ece55e7 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 @@ -22,7 +22,7 @@ public final class Yobibyte extends StorageUnit { @Serial private static final long serialVersionUID = -5606322878020884194L; - Yobibyte(@NotNull final BigInteger bytes) { + Yobibyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -30,9 +30,8 @@ public final class Yobibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Yobibyte contains. * @return A new Yobibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Yobibyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Yobibyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Yobibyte(numberOfBytes); } @@ -40,9 +39,8 @@ public final class Yobibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Yobibyte contains. * @return A new Yobibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Yobibyte valueOf(final long numberOfBytes) { + public static @NotNull Yobibyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -50,100 +48,86 @@ public final class Yobibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Yobibyte contains. * @return A new Yobibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Yobibyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Yobibyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Yobibyte add(final long bytesToAdd) { + public @NotNull Yobibyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Yobibyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Yobibyte add(final @NotNull BigInteger bytesToAdd) { return new Yobibyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Yobibyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Yobibyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Yobibyte divide(final long divisor) { + public @NotNull Yobibyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Yobibyte divide(@NotNull final BigInteger divisor) { + public @NotNull Yobibyte divide(final @NotNull BigInteger divisor) { return new Yobibyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Yobibyte multiply(final long factor) { + public @NotNull Yobibyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Yobibyte multiply(@NotNull final BigInteger factor) { + public @NotNull Yobibyte multiply(final @NotNull BigInteger factor) { return new Yobibyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Yobibyte subtract(final long bytesToSubtract) { + public @NotNull Yobibyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Yobibyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Yobibyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Yobibyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Yobibyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Yobibyte subtract(final @NotNull StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return StorageUnit.BYTES_IN_A_YOBIBYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "YiB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::binaryValueOf; } 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 347f812..b9e3b72 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 @@ -19,7 +19,7 @@ public final class Yottabyte extends StorageUnit { @Serial private static final long serialVersionUID = 2482152459842042316L; - Yottabyte(@NotNull final BigInteger bytes) { + Yottabyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Yottabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Yottabyte contains. * @return A new Yottabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Yottabyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Yottabyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Yottabyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Yottabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Yottabyte contains. * @return A new Yottabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Yottabyte valueOf(final long numberOfBytes) { + public static @NotNull Yottabyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Yottabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Yottabyte contains. * @return A new Yottabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Yottabyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Yottabyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Yottabyte add(final long bytesToAdd) { + public @NotNull Yottabyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Yottabyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Yottabyte add(final @NotNull BigInteger bytesToAdd) { return new Yottabyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Yottabyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Yottabyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Yottabyte divide(final long divisor) { + public @NotNull Yottabyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Yottabyte divide(@NotNull final BigInteger divisor) { + public @NotNull Yottabyte divide(final @NotNull BigInteger divisor) { return new Yottabyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Yottabyte multiply(final long factor) { + public @NotNull Yottabyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Yottabyte multiply(@NotNull final BigInteger factor) { + public @NotNull Yottabyte multiply(final @NotNull BigInteger factor) { return new Yottabyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Yottabyte subtract(final long bytesToSubtract) { + public @NotNull Yottabyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Yottabyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Yottabyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Yottabyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Yottabyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Yottabyte subtract(final @NotNull StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return StorageUnit.BYTES_IN_A_YOTTABYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "YB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::decimalValueOf; } 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 ca3fab3..acc7a6a 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 @@ -19,7 +19,7 @@ public final class Zebibyte extends StorageUnit { @Serial private static final long serialVersionUID = 2192254824473341887L; - Zebibyte(@NotNull final BigInteger bytes) { + Zebibyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Zebibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Zebibyte contains. * @return A new Zebibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Zebibyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Zebibyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Zebibyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Zebibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Zebibyte contains. * @return A new Zebibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Zebibyte valueOf(final long numberOfBytes) { + public static @NotNull Zebibyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Zebibyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Zebibyte contains. * @return A new Zebibyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Zebibyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Zebibyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Zebibyte add(final long bytesToAdd) { + public @NotNull Zebibyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Zebibyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Zebibyte add(final @NotNull BigInteger bytesToAdd) { return new Zebibyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Zebibyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Zebibyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Zebibyte divide(final long divisor) { + public @NotNull Zebibyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Zebibyte divide(@NotNull final BigInteger divisor) { + public @NotNull Zebibyte divide(final @NotNull BigInteger divisor) { return new Zebibyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Zebibyte multiply(final long factor) { + public @NotNull Zebibyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Zebibyte multiply(@NotNull final BigInteger factor) { + public @NotNull Zebibyte multiply(final @NotNull BigInteger factor) { return new Zebibyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Zebibyte subtract(final long bytesToSubtract) { + public @NotNull Zebibyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Zebibyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Zebibyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Zebibyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Zebibyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Zebibyte subtract(final @NotNull StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return StorageUnit.BYTES_IN_A_ZEBIBYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "ZiB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::binaryValueOf; } 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 8811231..c34f692 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 @@ -19,7 +19,7 @@ public final class Zettabyte extends StorageUnit { @Serial private static final long serialVersionUID = 8849006574018911826L; - Zettabyte(@NotNull final BigInteger bytes) { + Zettabyte(final @NotNull BigInteger bytes) { super(bytes); } @@ -27,9 +27,8 @@ public final class Zettabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Zettabyte contains. * @return A new Zettabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Zettabyte valueOf(@NotNull final BigInteger numberOfBytes) { + public static @NotNull Zettabyte valueOf(final @NotNull BigInteger numberOfBytes) { return new Zettabyte(numberOfBytes); } @@ -37,9 +36,8 @@ public final class Zettabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Zettabyte contains. * @return A new Zettabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Zettabyte valueOf(final long numberOfBytes) { + public static @NotNull Zettabyte valueOf(final long numberOfBytes) { return valueOf(BigInteger.valueOf(numberOfBytes)); } @@ -47,100 +45,86 @@ public final class Zettabyte extends StorageUnit { * @param numberOfBytes The amount of bytes the Zettabyte contains. * @return A new Zettabyte unit with the given value. */ - @NotNull @CheckReturnValue - public static Zettabyte valueOf(@NotNull final Long numberOfBytes) { + public static @NotNull Zettabyte valueOf(final @NotNull Long numberOfBytes) { return valueOf(numberOfBytes.longValue()); } @Override - @NotNull @CheckReturnValue - public Zettabyte add(final long bytesToAdd) { + public @NotNull Zettabyte add(final long bytesToAdd) { return add(BigInteger.valueOf(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Zettabyte add(@NotNull final BigInteger bytesToAdd) { + public @NotNull Zettabyte add(final @NotNull BigInteger bytesToAdd) { return new Zettabyte(bytes.add(bytesToAdd)); } @Override - @NotNull @CheckReturnValue - public Zettabyte add(@NotNull final StorageUnit storageAmount) { + public @NotNull Zettabyte add(final @NotNull StorageUnit storageAmount) { return add(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - public Zettabyte divide(final long divisor) { + public @NotNull Zettabyte divide(final long divisor) { return divide(BigInteger.valueOf(divisor)); } @Override - @NotNull @CheckReturnValue - public Zettabyte divide(@NotNull final BigInteger divisor) { + public @NotNull Zettabyte divide(final @NotNull BigInteger divisor) { return new Zettabyte(bytes.divide(divisor)); } @Override - @NotNull @CheckReturnValue - public Zettabyte multiply(final long factor) { + public @NotNull Zettabyte multiply(final long factor) { return multiply(BigInteger.valueOf(factor)); } @Override - @NotNull @CheckReturnValue - public Zettabyte multiply(@NotNull final BigInteger factor) { + public @NotNull Zettabyte multiply(final @NotNull BigInteger factor) { return new Zettabyte(bytes.multiply(factor)); } @Override - @NotNull @CheckReturnValue - public Zettabyte subtract(final long bytesToSubtract) { + public @NotNull Zettabyte subtract(final long bytesToSubtract) { return subtract(BigInteger.valueOf(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Zettabyte subtract(@NotNull final BigInteger bytesToSubtract) { + public @NotNull Zettabyte subtract(final @NotNull BigInteger bytesToSubtract) { return new Zettabyte(bytes.subtract(bytesToSubtract)); } @Override - @NotNull @CheckReturnValue - public Zettabyte subtract(@NotNull final StorageUnit storageAmount) { + public @NotNull Zettabyte subtract(final @NotNull StorageUnit storageAmount) { return subtract(storageAmount.bytes); } @Override - @NotNull @CheckReturnValue - protected BigInteger getNumberOfBytesPerUnit() { + protected @NotNull BigInteger getNumberOfBytesPerUnit() { return BYTES_IN_A_ZETTABYTE; } @Override - @NotNull @CheckReturnValue - protected String getSymbol() { + protected @NotNull String getSymbol() { return "ZB"; } @Override - @NotNull @CheckReturnValue - protected Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { + protected @NotNull Function<@NotNull BigInteger, @NotNull StorageUnit> converter() { return StorageUnits::decimalValueOf; } -- 2.11.4.GIT