@Test public void checkOrdinalMemberProvidedFromNumberWithConverter() throws ODataJPAModelException { cut = new IntermediateEnumerationType(new JPADefaultEdmNameBuilder(PUNIT_NAME), FileAccess.class); assertEquals(FileAccess.Write, cut.enumOf((short) 2)); }
@SuppressWarnings("unchecked") @Override public <T extends Enum<?>> T enumOf(final String value) throws ODataJPAModelException { lazyBuildEdmItem(); for (Object member : javaMembers) if (((T) member).name().equals(value)) return (T) member; return null; }
IntermediateEnumerationType extends IntermediateModelElement implements JPAEnumerationAttribute { @SuppressWarnings("unchecked") @Override public <T extends Enum<?>> T enumOf(final String value) throws ODataJPAModelException { lazyBuildEdmItem(); for (Object member : javaMembers) if (((T) member).name().equals(value)) return (T) member; return null; } }
IntermediateEnumerationType extends IntermediateModelElement implements JPAEnumerationAttribute { @SuppressWarnings("unchecked") @Override public <T extends Enum<?>> T enumOf(final String value) throws ODataJPAModelException { lazyBuildEdmItem(); for (Object member : javaMembers) if (((T) member).name().equals(value)) return (T) member; return null; } IntermediateEnumerationType(final JPAEdmNameBuilder nameBuilder, final Class<? extends Enum<?>> javaEnum); }
IntermediateEnumerationType extends IntermediateModelElement implements JPAEnumerationAttribute { @SuppressWarnings("unchecked") @Override public <T extends Enum<?>> T enumOf(final String value) throws ODataJPAModelException { lazyBuildEdmItem(); for (Object member : javaMembers) if (((T) member).name().equals(value)) return (T) member; return null; } IntermediateEnumerationType(final JPAEdmNameBuilder nameBuilder, final Class<? extends Enum<?>> javaEnum); @Override Object convert(List<String> values); @SuppressWarnings("unchecked") @Override T enumOf(final String value); @Override @SuppressWarnings("unchecked") E enumOf(final T value); @Override boolean isFlags(); @SuppressWarnings("unchecked") @Override T valueOf(final String value); @SuppressWarnings("unchecked") @Override T valueOf(final List<String> values); }
IntermediateEnumerationType extends IntermediateModelElement implements JPAEnumerationAttribute { @SuppressWarnings("unchecked") @Override public <T extends Enum<?>> T enumOf(final String value) throws ODataJPAModelException { lazyBuildEdmItem(); for (Object member : javaMembers) if (((T) member).name().equals(value)) return (T) member; return null; } IntermediateEnumerationType(final JPAEdmNameBuilder nameBuilder, final Class<? extends Enum<?>> javaEnum); @Override Object convert(List<String> values); @SuppressWarnings("unchecked") @Override T enumOf(final String value); @Override @SuppressWarnings("unchecked") E enumOf(final T value); @Override boolean isFlags(); @SuppressWarnings("unchecked") @Override T valueOf(final String value); @SuppressWarnings("unchecked") @Override T valueOf(final List<String> values);  }