/** * Obtains an instance from the specified unique name. * * @param uniqueName the unique name * @return the index * @throws IllegalArgumentException if the name is not known */ @FromString public static PriceIndex of(String uniqueName) { ArgChecker.notNull(uniqueName, "uniqueName"); return extendedEnum().lookup(uniqueName); }
@Test(dataProvider = "name") public void test_extendedEnum(PriceIndex convention, String name) { ImmutableMap<String, PriceIndex> map = PriceIndex.extendedEnum().lookupAll(); assertEquals(map.get(name), convention); }
return (Optional) overnightOpt; Optional<PriceIndex> priceOpt = PriceIndex.extendedEnum().find(indexStr); if (priceOpt.isPresent()) { return (Optional) priceOpt;
public void test_getFloatingRateName() { for (PriceIndex index : PriceIndex.extendedEnum().lookupAll().values()) { assertEquals(index.getFloatingRateName(), FloatingRateName.of(index.getName())); } }