@Test public void testGetNewDefectStatus() { handler.async(); String status = customizationService.getNewDefectStatus(new NonDispatchTestCallback<String>(handler) { @Override protected void evaluate(String data) { Assert.assertEquals("New", data); Assert.assertEquals("New", customizationService.getNewDefectStatus(null)); } }); Assert.assertNull(status); customizationService.getNewDefectStatus(new NonDispatchTestCallback<String>(handler) { @Override protected void evaluate(String data) { Assert.assertEquals("New", data); Assert.assertEquals("New", customizationService.getNewDefectStatus(null)); } }); }
public String getNewDefectStatus(final AbstractCachingService.Callback<String> whenLoaded) { APMCommonSettings settings = getCachedValue(IDE_PREFERENCES); if(settings == null) { getValueAsync(IDE_PREFERENCES, translate(whenLoaded, new Transform<APMCommonSettings, String>() { @Override public String transform(APMCommonSettings settings) { return getNewDefectStatus(settings); } })); return null; } else { return getNewDefectStatus(settings); } }
CustomizationService extends AbstractCachingService<Integer, APMCommonSettings, AbstractCachingService.Callback<APMCommonSettings>> { public String getNewDefectStatus(final AbstractCachingService.Callback<String> whenLoaded) { APMCommonSettings settings = getCachedValue(IDE_PREFERENCES); if(settings == null) { getValueAsync(IDE_PREFERENCES, translate(whenLoaded, new Transform<APMCommonSettings, String>() { @Override public String transform(APMCommonSettings settings) { return getNewDefectStatus(settings); } })); return null; } else { return getNewDefectStatus(settings); } } }
CustomizationService extends AbstractCachingService<Integer, APMCommonSettings, AbstractCachingService.Callback<APMCommonSettings>> { public String getNewDefectStatus(final AbstractCachingService.Callback<String> whenLoaded) { APMCommonSettings settings = getCachedValue(IDE_PREFERENCES); if(settings == null) { getValueAsync(IDE_PREFERENCES, translate(whenLoaded, new Transform<APMCommonSettings, String>() { @Override public String transform(APMCommonSettings settings) { return getNewDefectStatus(settings); } })); return null; } else { return getNewDefectStatus(settings); } } CustomizationService(Project project); }
CustomizationService extends AbstractCachingService<Integer, APMCommonSettings, AbstractCachingService.Callback<APMCommonSettings>> { public String getNewDefectStatus(final AbstractCachingService.Callback<String> whenLoaded) { APMCommonSettings settings = getCachedValue(IDE_PREFERENCES); if(settings == null) { getValueAsync(IDE_PREFERENCES, translate(whenLoaded, new Transform<APMCommonSettings, String>() { @Override public String transform(APMCommonSettings settings) { return getNewDefectStatus(settings); } })); return null; } else { return getNewDefectStatus(settings); } } CustomizationService(Project project); String getNewDefectStatus(final AbstractCachingService.Callback<String> whenLoaded); }
CustomizationService extends AbstractCachingService<Integer, APMCommonSettings, AbstractCachingService.Callback<APMCommonSettings>> { public String getNewDefectStatus(final AbstractCachingService.Callback<String> whenLoaded) { APMCommonSettings settings = getCachedValue(IDE_PREFERENCES); if(settings == null) { getValueAsync(IDE_PREFERENCES, translate(whenLoaded, new Transform<APMCommonSettings, String>() { @Override public String transform(APMCommonSettings settings) { return getNewDefectStatus(settings); } })); return null; } else { return getNewDefectStatus(settings); } } CustomizationService(Project project); String getNewDefectStatus(final AbstractCachingService.Callback<String> whenLoaded);  }