MetricDescriptor extends AbstractRegisteredItem { @Override public String toString() { return id() + "\t" + label + "\t" + unitLabel + "\t" + description(); } MetricDescriptor(String theId, String theLabel, Function<? extends Object, ? extends Object> theFunction, String aUnitLabel, String theDescription); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); final String label; final Function<? extends Object, ? extends Object> function; final String unitLabel; }
@Test public void toStringTest() { MetricDescriptor md = new MetricDescriptor("beatFrequency", "Beat frequency", null, "Hz", "The interference resulting from the union of two signals"); String textForm = md.toString(); assertEquals("beatFrequency Beat frequency Hz The interference resulting from the union of two signals", textForm); }