summaryrefslogtreecommitdiff
path: root/src/main/java/sevenUnits/unit/UnitlikeValue.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/sevenUnits/unit/UnitlikeValue.java')
-rw-r--r--src/main/java/sevenUnits/unit/UnitlikeValue.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/main/java/sevenUnits/unit/UnitlikeValue.java b/src/main/java/sevenUnits/unit/UnitlikeValue.java
index 26354b1..ad0d1ea 100644
--- a/src/main/java/sevenUnits/unit/UnitlikeValue.java
+++ b/src/main/java/sevenUnits/unit/UnitlikeValue.java
@@ -34,10 +34,10 @@ final class UnitlikeValue<T extends Unitlike<V>, V> {
V value) {
return new UnitlikeValue<>(unitlike, value);
}
-
+
private final T unitlike;
private final V value;
-
+
/**
* @param unitlike
* @param value
@@ -47,7 +47,7 @@ final class UnitlikeValue<T extends Unitlike<V>, V> {
this.unitlike = unitlike;
this.value = value;
}
-
+
/**
* @return true if this value can be converted to {@code other}.
* @since 2020-10-01
@@ -55,7 +55,7 @@ final class UnitlikeValue<T extends Unitlike<V>, V> {
public final boolean canConvertTo(Unit other) {
return this.unitlike.canConvertTo(other);
}
-
+
/**
* @return true if this value can be converted to {@code other}.
* @since 2020-10-01
@@ -63,7 +63,7 @@ final class UnitlikeValue<T extends Unitlike<V>, V> {
public final <W> boolean canConvertTo(Unitlike<W> other) {
return this.unitlike.canConvertTo(other);
}
-
+
/**
* Returns a UnitlikeValue that represents the same value expressed in a
* different unitlike form.
@@ -76,7 +76,7 @@ final class UnitlikeValue<T extends Unitlike<V>, V> {
return UnitlikeValue.of(other,
this.unitlike.convertTo(other, this.getValue()));
}
-
+
/**
* Returns a UnitValue that represents the same value expressed in a
* different unit
@@ -88,7 +88,7 @@ final class UnitlikeValue<T extends Unitlike<V>, V> {
return UnitValue.of(other,
this.unitlike.convertTo(other, this.getValue()));
}
-
+
/**
* Returns this unit value represented as a {@code LinearUnitValue} with this
* unit's base unit as the base.
@@ -101,7 +101,7 @@ final class UnitlikeValue<T extends Unitlike<V>, V> {
final LinearUnit base = LinearUnit.getBase(this.unitlike).withName(ns);
return this.convertToLinear(base);
}
-
+
/**
* @return a {@code LinearUnitValue} that is equivalent to this value. It
* will have zero uncertainty.
@@ -111,7 +111,7 @@ final class UnitlikeValue<T extends Unitlike<V>, V> {
return LinearUnitValue.getExact(other,
this.getUnitlike().convertTo(other, this.getValue()));
}
-
+
@Override
public boolean equals(Object obj) {
if (this == obj)
@@ -131,7 +131,7 @@ final class UnitlikeValue<T extends Unitlike<V>, V> {
return false;
return true;
}
-
+
/**
* @return the unitlike
* @since 2020-09-29
@@ -139,7 +139,7 @@ final class UnitlikeValue<T extends Unitlike<V>, V> {
public final Unitlike<V> getUnitlike() {
return this.unitlike;
}
-
+
/**
* @return the value
* @since 2020-09-29
@@ -147,7 +147,7 @@ final class UnitlikeValue<T extends Unitlike<V>, V> {
public final V getValue() {
return this.value;
}
-
+
@Override
public int hashCode() {
final int prime = 31;
@@ -158,7 +158,7 @@ final class UnitlikeValue<T extends Unitlike<V>, V> {
+ (this.getValue() == null ? 0 : this.getValue().hashCode());
return result;
}
-
+
@Override
public String toString() {
final Optional<String> primaryName = this.getUnitlike().getPrimaryName();