summaryrefslogtreecommitdiff
path: root/src/org/unitConverter/unit/Unit.java
diff options
context:
space:
mode:
authorAdrien Hopkins <masterofnumbers17@gmail.com>2019-11-26 15:20:04 -0500
committerAdrien Hopkins <masterofnumbers17@gmail.com>2019-11-26 15:20:04 -0500
commita966676c629f7f14fcbba82a9ada5e2cbeca8314 (patch)
tree63e93526528f963d99570230a4b72830400840bc /src/org/unitConverter/unit/Unit.java
parent7bf4824a0619a79cb10faf8f83146b96e51341d2 (diff)
Updated the documentation of existing classes.
Diffstat (limited to 'src/org/unitConverter/unit/Unit.java')
-rw-r--r--src/org/unitConverter/unit/Unit.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/unitConverter/unit/Unit.java b/src/org/unitConverter/unit/Unit.java
index d848ea1..737802a 100644
--- a/src/org/unitConverter/unit/Unit.java
+++ b/src/org/unitConverter/unit/Unit.java
@@ -511,7 +511,8 @@ public abstract class Unit {
public String toString() {
return this.getPrimaryName().orElse("Unnamed unit")
+ (this.getSymbol().isPresent() ? String.format(" (%s)", this.getSymbol().get()) : "")
- + ", derived from " + this.getBase().toString();
+ + ", derived from " + this.getBase().toString(u -> u.getSymbol().get())
+ + (this.getOtherNames().isEmpty() ? "" : ", also called " + String.join(", ", this.getOtherNames()));
}
/**