@Test public void testGetProfile() throws ConfigurationException { DeviceProfileManager manager = new DeviceProfileManager(); manager.updated( "1", getMockedProperties( "foo", "bar" ) ); assertNotNull( manager.getProfile( "foo" ) ); assertNull( manager.getProfile( "FOO" ) ); }
public DeviceProfile getProfile( final String aType ) { final Collection<DeviceProfile> allProfiles = getProfiles(); for ( DeviceProfile profile : allProfiles ) { if ( aType.equals( profile.getType() ) ) { return profile; } } return null; }
DeviceProfileManager implements ManagedServiceFactory { public DeviceProfile getProfile( final String aType ) { final Collection<DeviceProfile> allProfiles = getProfiles(); for ( DeviceProfile profile : allProfiles ) { if ( aType.equals( profile.getType() ) ) { return profile; } } return null; } }
DeviceProfileManager implements ManagedServiceFactory { public DeviceProfile getProfile( final String aType ) { final Collection<DeviceProfile> allProfiles = getProfiles(); for ( DeviceProfile profile : allProfiles ) { if ( aType.equals( profile.getType() ) ) { return profile; } } return null; } DeviceProfileManager(); }
DeviceProfileManager implements ManagedServiceFactory { public DeviceProfile getProfile( final String aType ) { final Collection<DeviceProfile> allProfiles = getProfiles(); for ( DeviceProfile profile : allProfiles ) { if ( aType.equals( profile.getType() ) ) { return profile; } } return null; } DeviceProfileManager(); @Override void deleted( final String aPid ); DeviceProfile findProfile( final String aIdentifier ); DeviceProfile getDefaultProfile(); @Override String getName(); DeviceProfile getProfile( final String aType ); List<DeviceProfile> getProfiles(); int getSize(); @Override @SuppressWarnings( "rawtypes" ) void updated( final String aPid, final Dictionary aProperties ); }
DeviceProfileManager implements ManagedServiceFactory { public DeviceProfile getProfile( final String aType ) { final Collection<DeviceProfile> allProfiles = getProfiles(); for ( DeviceProfile profile : allProfiles ) { if ( aType.equals( profile.getType() ) ) { return profile; } } return null; } DeviceProfileManager(); @Override void deleted( final String aPid ); DeviceProfile findProfile( final String aIdentifier ); DeviceProfile getDefaultProfile(); @Override String getName(); DeviceProfile getProfile( final String aType ); List<DeviceProfile> getProfiles(); int getSize(); @Override @SuppressWarnings( "rawtypes" ) void updated( final String aPid, final Dictionary aProperties ); static final String SERVICE_PID; }