/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static AsciiTableAlignment of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static PaymentOnDefault of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static EtdExpiryType of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static CashSwaptionSettlementMethod of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static BillYieldConvention of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static LongShort of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static FloatingRateType of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static SabrParameterType of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static EtdSettlementType of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static CurveNodeDateType of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static FraDiscountingMethod of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static StubConvention of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static SwapLegType of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static BarrierType of(String name) { return NAMES.parse(name); }
/** * Obtains an instance from the specified name. * <p> * Parsing handles the mixed case form produced by {@link #toString()} and * the upper and lower case variants of the enum constant name. * * @param name the name to parse * @return the type * @throws IllegalArgumentException if the name is not known */ @FromString public static ShiftType of(String name) { return NAMES.parse(name); }
public void test_parse_wooBarWaa() { EnumNames<MockEnum> test = EnumNames.of(MockEnum.class); assertEquals(test.parse("WooBarWaa"), MockEnum.WOO_BAR_WAA); assertEquals(test.parse("WOOBARWAA"), MockEnum.WOO_BAR_WAA); assertEquals(test.parse("woobarwaa"), MockEnum.WOO_BAR_WAA); assertEquals(test.parse("WOO_BAR_WAA"), MockEnum.WOO_BAR_WAA); assertEquals(test.parse("woo_bar_waa"), MockEnum.WOO_BAR_WAA); }
public void test_parse_fooBar() { EnumNames<MockEnum> test = EnumNames.of(MockEnum.class); assertEquals(test.parse("Foobar"), MockEnum.FooBar); assertEquals(test.parse("FOOBAR"), MockEnum.FooBar); assertEquals(test.parse("foobar"), MockEnum.FooBar); assertEquals(test.parse("FooBar"), MockEnum.FooBar); }
public void test_parse_twentyOne() { EnumNames<MockEnum> test = EnumNames.of(MockEnum.class); assertEquals(test.parse("TwentyOne"), MockEnum.TWENTY_ONE); assertEquals(test.parse("TWENTYONE"), MockEnum.TWENTY_ONE); assertEquals(test.parse("twentyone"), MockEnum.TWENTY_ONE); assertEquals(test.parse("TWENTY_ONE"), MockEnum.TWENTY_ONE); assertEquals(test.parse("twenty_one"), MockEnum.TWENTY_ONE); }
public void test_parse_invalid() { EnumNames<MockEnum> test = EnumNames.of(MockEnum.class); assertThatThrownBy(() -> test.parse("unknown")) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("Unknown enum name 'unknown' for type " + MockEnum.class.getName()); }