From a966676c629f7f14fcbba82a9ada5e2cbeca8314 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Tue, 26 Nov 2019 15:20:04 -0500 Subject: Updated the documentation of existing classes. --- src/org/unitConverter/unit/Unit.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/org/unitConverter/unit/Unit.java') 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())); } /** -- cgit v1.2.3