Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@
</executions>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<inherited>true</inherited>
<configuration>
<source>${version.jdk}</source>
<target>${version.jdk}</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>

</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public final class Byte extends StorageUnit<Byte> {
}

@Override
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return BigInteger.ONE;
}

Expand All @@ -123,4 +123,9 @@ public final class Byte extends StorageUnit<Byte> {
return StorageUnits::binaryValueOf;
}

@Override
protected int conversionScale() {
return 0;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public final class Exabyte extends StorageUnit<Exabyte> {
@Serial
private static final long serialVersionUID = 6846441733771841250L;

private static final int conversionScale = computeFiniteConversionScale(StorageUnit.BYTES_IN_A_EXABYTE);

Exabyte(final @NotNull BigInteger numberOfBytes) {
super(numberOfBytes);
}
Expand Down Expand Up @@ -112,7 +114,7 @@ public final class Exabyte extends StorageUnit<Exabyte> {

@Override
@CheckReturnValue
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return StorageUnit.BYTES_IN_A_EXABYTE;
}

Expand All @@ -128,4 +130,9 @@ public final class Exabyte extends StorageUnit<Exabyte> {
return StorageUnits::decimalValueOf;
}

@Override
protected int conversionScale() {
return conversionScale;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public final class Exbibyte extends StorageUnit<Exbibyte> {
@Serial
private static final long serialVersionUID = 5993490571003918471L;

private static final int conversionScale = computeFiniteConversionScale(StorageUnit.BYTES_IN_A_EXBIBYTE);

Exbibyte(final @NotNull BigInteger numberOfBytes) {
super(numberOfBytes);
}
Expand All @@ -38,7 +40,7 @@ public final class Exbibyte extends StorageUnit<Exbibyte> {
*/
@CheckReturnValue
public static @NotNull Exbibyte valueOf(final long numberOfBytes) {
return valueOf(BigInteger.valueOf(numberOfBytes));
return valueOf(java.math.BigInteger.valueOf(numberOfBytes));
}

/**
Expand Down Expand Up @@ -112,7 +114,7 @@ public final class Exbibyte extends StorageUnit<Exbibyte> {

@Override
@CheckReturnValue
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return StorageUnit.BYTES_IN_A_EXBIBYTE;
}

Expand All @@ -128,4 +130,9 @@ public final class Exbibyte extends StorageUnit<Exbibyte> {
return StorageUnits::binaryValueOf;
}

@Override
protected int conversionScale() {
return conversionScale;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public final class Gibibyte extends StorageUnit<Gibibyte> {
@Serial
private static final long serialVersionUID = -1104749948510944566L;

private static final int conversionScale = computeFiniteConversionScale(StorageUnit.BYTES_IN_A_GIBIBYTE);

Gibibyte(final @NotNull BigInteger numberOfBytes) {
super(numberOfBytes);
}
Expand Down Expand Up @@ -112,7 +114,7 @@ public final class Gibibyte extends StorageUnit<Gibibyte> {

@Override
@CheckReturnValue
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return BYTES_IN_A_GIBIBYTE;
}

Expand All @@ -128,4 +130,9 @@ public final class Gibibyte extends StorageUnit<Gibibyte> {
return StorageUnits::binaryValueOf;
}

@Override
protected int conversionScale() {
return conversionScale;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public final class Gigabyte extends StorageUnit<Gigabyte> {
@Serial
private static final long serialVersionUID = 7581075190529125530L;

private static final int conversionScale = computeFiniteConversionScale(StorageUnit.BYTES_IN_A_GIGABYTE);

Gigabyte(final @NotNull BigInteger numberOfBytes) {
super(numberOfBytes);
}
Expand Down Expand Up @@ -112,7 +114,7 @@ public final class Gigabyte extends StorageUnit<Gigabyte> {

@Override
@CheckReturnValue
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return BYTES_IN_A_GIGABYTE;
}

Expand All @@ -128,4 +130,9 @@ public final class Gigabyte extends StorageUnit<Gigabyte> {
return StorageUnits::decimalValueOf;
}

@Override
protected int conversionScale() {
return conversionScale;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public final class Kibibyte extends StorageUnit<Kibibyte> {
@Serial
private static final long serialVersionUID = 3798828851496657978L;

private static final int conversionScale = computeFiniteConversionScale(StorageUnit.BYTES_IN_A_KIBIBYTE);

Kibibyte(final @NotNull BigInteger numberOfBytes) {
super(numberOfBytes);
}
Expand Down Expand Up @@ -112,7 +114,7 @@ public final class Kibibyte extends StorageUnit<Kibibyte> {

@Override
@CheckReturnValue
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return StorageUnit.BYTES_IN_A_KIBIBYTE;
}

Expand All @@ -128,4 +130,9 @@ public final class Kibibyte extends StorageUnit<Kibibyte> {
return StorageUnits::binaryValueOf;
}

@Override
protected int conversionScale() {
return conversionScale;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public final class Kilobyte extends StorageUnit<Kilobyte> {
@Serial
private static final long serialVersionUID = 6952239416014811456L;

private static final int conversionScale = computeFiniteConversionScale(StorageUnit.BYTES_IN_A_KILOBYTE);

Kilobyte(final @NotNull BigInteger numberOfBytes) {
super(numberOfBytes);
}
Expand Down Expand Up @@ -112,7 +114,7 @@ public final class Kilobyte extends StorageUnit<Kilobyte> {

@Override
@CheckReturnValue
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return BYTES_IN_A_KILOBYTE;
}

Expand All @@ -128,4 +130,9 @@ public final class Kilobyte extends StorageUnit<Kilobyte> {
return StorageUnits::decimalValueOf;
}

@Override
protected int conversionScale() {
return conversionScale;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public final class Mebibyte extends StorageUnit<Mebibyte> {
@Serial
private static final long serialVersionUID = 7697583678146919524L;

private static final int conversionScale = computeFiniteConversionScale(StorageUnit.BYTES_IN_A_MEBIBYTE);

Mebibyte(final @NotNull BigInteger numberOfBytes) {
super(numberOfBytes);
}
Expand Down Expand Up @@ -112,7 +114,7 @@ public final class Mebibyte extends StorageUnit<Mebibyte> {

@Override
@CheckReturnValue
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return StorageUnit.BYTES_IN_A_MEBIBYTE;
}

Expand All @@ -128,4 +130,9 @@ public final class Mebibyte extends StorageUnit<Mebibyte> {
return StorageUnits::binaryValueOf;
}

@Override
protected int conversionScale() {
return conversionScale;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public final class Megabyte extends StorageUnit<Megabyte> {
@Serial
private static final long serialVersionUID = 5901923092058760111L;

private static final int conversionScale = computeFiniteConversionScale(StorageUnit.BYTES_IN_A_MEGABYTE);

Megabyte(final @NotNull BigInteger numberOfBytes) {
super(numberOfBytes);
}
Expand Down Expand Up @@ -112,7 +114,7 @@ public final class Megabyte extends StorageUnit<Megabyte> {

@Override
@CheckReturnValue
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return StorageUnit.BYTES_IN_A_MEGABYTE;
}

Expand All @@ -128,4 +130,9 @@ public final class Megabyte extends StorageUnit<Megabyte> {
return StorageUnits::decimalValueOf;
}

@Override
protected int conversionScale() {
return conversionScale;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public final class Pebibyte extends StorageUnit<Pebibyte> {
@Serial
private static final long serialVersionUID = -6112472064345339882L;

private static final int conversionScale = computeFiniteConversionScale(StorageUnit.BYTES_IN_A_PEBIBYTE);

Pebibyte(final @NotNull BigInteger numberOfBytes) {
super(numberOfBytes);
}
Expand Down Expand Up @@ -112,7 +114,7 @@ public final class Pebibyte extends StorageUnit<Pebibyte> {

@Override
@CheckReturnValue
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return StorageUnit.BYTES_IN_A_PEBIBYTE;
}

Expand All @@ -128,4 +130,9 @@ public final class Pebibyte extends StorageUnit<Pebibyte> {
return StorageUnits::binaryValueOf;
}

@Override
protected int conversionScale() {
return conversionScale;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public final class Petabyte extends StorageUnit<Petabyte> {
@Serial
private static final long serialVersionUID = 5889808368085688387L;

private static final int conversionScale = computeFiniteConversionScale(StorageUnit.BYTES_IN_A_PETABYTE);

Petabyte(final @NotNull BigInteger numberOfBytes) {
super(numberOfBytes);
}
Expand Down Expand Up @@ -112,7 +114,7 @@ public final class Petabyte extends StorageUnit<Petabyte> {

@Override
@CheckReturnValue
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return StorageUnit.BYTES_IN_A_PETABYTE;
}

Expand All @@ -128,4 +130,9 @@ public final class Petabyte extends StorageUnit<Petabyte> {
return StorageUnits::decimalValueOf;
}

@Override
protected int conversionScale() {
return conversionScale;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public final class Qubibyte extends StorageUnit<Qubibyte> {
@Serial
private static final long serialVersionUID = 8611754914470986560L;

private static final int conversionScale = computeFiniteConversionScale(StorageUnit.BYTES_IN_A_QUBIBYTE);

Qubibyte(final @NotNull BigInteger numberOfBytes) {
super(numberOfBytes);
}
Expand Down Expand Up @@ -112,7 +114,7 @@ public final class Qubibyte extends StorageUnit<Qubibyte> {

@Override
@CheckReturnValue
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return StorageUnit.BYTES_IN_A_QUBIBYTE;
}

Expand All @@ -128,4 +130,9 @@ public final class Qubibyte extends StorageUnit<Qubibyte> {
return StorageUnits::binaryValueOf;
}

@Override
protected int conversionScale() {
return conversionScale;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public final class Quettabyte extends StorageUnit<Quettabyte> {
@Serial
private static final long serialVersionUID = -7866123408102424489L;

private static final int conversionScale = computeFiniteConversionScale(StorageUnit.BYTES_IN_A_QUETTABYTE);

Quettabyte(final @NotNull BigInteger numberOfBytes) {
super(numberOfBytes);
}
Expand Down Expand Up @@ -112,7 +114,7 @@ public final class Quettabyte extends StorageUnit<Quettabyte> {

@Override
@CheckReturnValue
protected @NotNull BigInteger getNumberOfBytesPerUnit() {
public @NotNull BigInteger getNumberOfBytesPerUnit() {
return StorageUnit.BYTES_IN_A_QUETTABYTE;
}

Expand All @@ -128,4 +130,9 @@ public final class Quettabyte extends StorageUnit<Quettabyte> {
return StorageUnits::decimalValueOf;
}

@Override
protected int conversionScale() {
return conversionScale;
}

}
Loading