@Test( expected = IllegalArgumentException.class ) public void testPutNullEnumValueFail() { new UserSettingsImpl( "foo" ).putEnumValue( "test", ( TestEnum )null ); }
protected <T extends Enum<T>> void putEnumValue( final String aName, final T aValue ) { if ( aValue == null ) { throw new IllegalArgumentException( "Enum cannot be null! Use delete() method to delete a key-value pair!" ); } this.properties.put( aName, aValue.name() ); }
UserSettingsImpl implements UserSettings { protected <T extends Enum<T>> void putEnumValue( final String aName, final T aValue ) { if ( aValue == null ) { throw new IllegalArgumentException( "Enum cannot be null! Use delete() method to delete a key-value pair!" ); } this.properties.put( aName, aValue.name() ); } }
UserSettingsImpl implements UserSettings { protected <T extends Enum<T>> void putEnumValue( final String aName, final T aValue ) { if ( aValue == null ) { throw new IllegalArgumentException( "Enum cannot be null! Use delete() method to delete a key-value pair!" ); } this.properties.put( aName, aValue.name() ); } UserSettingsImpl( final String aName );  UserSettingsImpl( final String aName, final Properties aProperties ); protected  UserSettingsImpl( final UserSettings aSettings ); }
UserSettingsImpl implements UserSettings { protected <T extends Enum<T>> void putEnumValue( final String aName, final T aValue ) { if ( aValue == null ) { throw new IllegalArgumentException( "Enum cannot be null! Use delete() method to delete a key-value pair!" ); } this.properties.put( aName, aValue.name() ); } UserSettingsImpl( final String aName );  UserSettingsImpl( final String aName, final Properties aProperties ); protected  UserSettingsImpl( final UserSettings aSettings ); @Override String get( final String aName, final String aDefaultValue ); @Override boolean getBoolean( final String aName, final boolean aDefaultValue ); @Override int getInt( final String aName, final int aDefaultValue ); @Override long getLong( final String aName, final long aDefaultValue ); @Override String getName(); Properties getProperties(); @Override Iterator<Entry<String, Object>> iterator(); @Override void put( final String aName, final String aValue ); @Override void putAll( final Map<?, ?> aSettings ); @Override void putBoolean( final String aName, final boolean aValue ); @Override void putInt( final String aName, final int aValue ); @Override void putLong( final String aName, final long aValue ); }
UserSettingsImpl implements UserSettings { protected <T extends Enum<T>> void putEnumValue( final String aName, final T aValue ) { if ( aValue == null ) { throw new IllegalArgumentException( "Enum cannot be null! Use delete() method to delete a key-value pair!" ); } this.properties.put( aName, aValue.name() ); } UserSettingsImpl( final String aName );  UserSettingsImpl( final String aName, final Properties aProperties ); protected  UserSettingsImpl( final UserSettings aSettings ); @Override String get( final String aName, final String aDefaultValue ); @Override boolean getBoolean( final String aName, final boolean aDefaultValue ); @Override int getInt( final String aName, final int aDefaultValue ); @Override long getLong( final String aName, final long aDefaultValue ); @Override String getName(); Properties getProperties(); @Override Iterator<Entry<String, Object>> iterator(); @Override void put( final String aName, final String aValue ); @Override void putAll( final Map<?, ?> aSettings ); @Override void putBoolean( final String aName, final boolean aValue ); @Override void putInt( final String aName, final int aValue ); @Override void putLong( final String aName, final long aValue );  }