Class FixedResizerFactory
- java.lang.Object
-
- net.coobird.thumbnailator.resizers.FixedResizerFactory
-
- All Implemented Interfaces:
ResizerFactory
public class FixedResizerFactory extends java.lang.Object implements ResizerFactory
AResizerFactorythat returns a specificResizerunconditionally.- Since:
- 0.4.0
-
-
Constructor Summary
Constructors Constructor Description FixedResizerFactory(Resizer resizer)Creates an instance of theFixedResizerFactorywhich returns the speicifedResizerunder all circumstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResizergetResizer()Returns the defaultResizer.ResizergetResizer(java.awt.Dimension originalSize, java.awt.Dimension thumbnailSize)Returns a suitableResizer, given theDimensions of the original image and the thumbnail image.
-
-
-
Field Detail
-
resizer
private final Resizer resizer
The resizer which is to be returned unconditionally by this class.
-
-
Constructor Detail
-
FixedResizerFactory
public FixedResizerFactory(Resizer resizer)
Creates an instance of theFixedResizerFactorywhich returns the speicifedResizerunder all circumstances.- Parameters:
resizer- TheResizerinstance that is to be returned under all circumstances.
-
-
Method Detail
-
getResizer
public Resizer getResizer()
Description copied from interface:ResizerFactoryReturns the defaultResizer.- Specified by:
getResizerin interfaceResizerFactory- Returns:
- The default
Resizer.
-
getResizer
public Resizer getResizer(java.awt.Dimension originalSize, java.awt.Dimension thumbnailSize)
Description copied from interface:ResizerFactoryReturns a suitableResizer, given theDimensions of the original image and the thumbnail image.- Specified by:
getResizerin interfaceResizerFactory- Parameters:
originalSize- The size of the original image.thumbnailSize- The size of the thumbnail.- Returns:
- The suitable
Resizerto perform the resizing operation for the given condition.
-
-