@Test( expected = IllegalArgumentException.class ) public void getValueInvalid() { TestPlanDefinition planDefinition = new TestPlanDefinition(); BaseExtensionUtils.setStringValue( EventStatusExtensionUtils.URL, planDefinition, "ABC", TypeFactory::createType ); EventStatusExtensionUtils.getValue( planDefinition ); }
@Nullable public static EventStatus getValue( @Nonnull IBaseHasExtensions resource ) throws IllegalArgumentException { final String stringValue = BaseExtensionUtils.getStringValue( URL, resource ); if ( stringValue == null ) { return null; } try { return EventStatus.valueOf( stringValue ); } catch ( IllegalArgumentException e ) { throw new IllegalArgumentException( "Invalid event status: " + stringValue ); } }
EventStatusExtensionUtils { @Nullable public static EventStatus getValue( @Nonnull IBaseHasExtensions resource ) throws IllegalArgumentException { final String stringValue = BaseExtensionUtils.getStringValue( URL, resource ); if ( stringValue == null ) { return null; } try { return EventStatus.valueOf( stringValue ); } catch ( IllegalArgumentException e ) { throw new IllegalArgumentException( "Invalid event status: " + stringValue ); } } }
EventStatusExtensionUtils { @Nullable public static EventStatus getValue( @Nonnull IBaseHasExtensions resource ) throws IllegalArgumentException { final String stringValue = BaseExtensionUtils.getStringValue( URL, resource ); if ( stringValue == null ) { return null; } try { return EventStatus.valueOf( stringValue ); } catch ( IllegalArgumentException e ) { throw new IllegalArgumentException( "Invalid event status: " + stringValue ); } } private  EventStatusExtensionUtils(); }
EventStatusExtensionUtils { @Nullable public static EventStatus getValue( @Nonnull IBaseHasExtensions resource ) throws IllegalArgumentException { final String stringValue = BaseExtensionUtils.getStringValue( URL, resource ); if ( stringValue == null ) { return null; } try { return EventStatus.valueOf( stringValue ); } catch ( IllegalArgumentException e ) { throw new IllegalArgumentException( "Invalid event status: " + stringValue ); } } private  EventStatusExtensionUtils(); static void setValue( @Nonnull IBaseHasExtensions resource, @Nullable EventStatus eventStatus, @Nonnull Function<String, IElement> typeFactory ); @Nullable static EventStatus getValue( @Nonnull IBaseHasExtensions resource ); }
EventStatusExtensionUtils { @Nullable public static EventStatus getValue( @Nonnull IBaseHasExtensions resource ) throws IllegalArgumentException { final String stringValue = BaseExtensionUtils.getStringValue( URL, resource ); if ( stringValue == null ) { return null; } try { return EventStatus.valueOf( stringValue ); } catch ( IllegalArgumentException e ) { throw new IllegalArgumentException( "Invalid event status: " + stringValue ); } } private  EventStatusExtensionUtils(); static void setValue( @Nonnull IBaseHasExtensions resource, @Nullable EventStatus eventStatus, @Nonnull Function<String, IElement> typeFactory ); @Nullable static EventStatus getValue( @Nonnull IBaseHasExtensions resource ); static final String URL; }