MetricDescriptor extends AbstractRegisteredItem { public MetricDescriptor(String theId, String theLabel, Function<? extends Object, ? extends Object> theFunction, String aUnitLabel, String theDescription) { super(theId, theDescription); label = theLabel; function = theFunction; unitLabel = aUnitLabel; } 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 MetricDescriptor() { MetricDescriptor md = new MetricDescriptor("beatFrequency", "Beat frequency", null, "Hz", "The interference resulting from the union of two signals"); assertEquals(md.id(), "beatFrequency"); assertEquals(md.label, "Beat frequency"); assertEquals(md.function, null); assertEquals(md.unitLabel, "Hz"); assertEquals(md.description(), "The interference resulting from the union of two signals"); }