/** * Set the target size of the image. * * @param width * @param height * @return Fluent API */ default ImageManipulationParameters setSize(int width, int height) { setWidth(width); setHeight(height); return this; }
@Test public void testCacheKey() { String cacheKey = new ImageManipulationParametersImpl().getCacheKey(); assertEquals("fp0.5-0.5", cacheKey); cacheKey = new ImageManipulationParametersImpl().setWidth(100).setHeight(200).getCacheKey(); assertEquals("rw100rh200fp0.5-0.5", cacheKey); cacheKey = new ImageManipulationParametersImpl().setWidth(100).setHeight(200).setRect(10, 22, 20, 21).getCacheKey(); assertEquals("rect10,22,21,20rw100rh200fp0.5-0.5", cacheKey); }