-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageFormatsBundle.java
More file actions
54 lines (43 loc) · 1.32 KB
/
ImageFormatsBundle.java
File metadata and controls
54 lines (43 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package infra.images.util;
import infra.images.format.ImageFormat;
import infra.images.format.OriginalFormat;
import java.util.Map;
/**
* @author alari
* @since 12/21/12 9:37 PM
*/
public class ImageFormatsBundle {
private final Map<String, ImageFormat> formats;
private final ImageFormat baseFormat;
private final String name;
private final ImageFormat original;
private Integer version;
public ImageFormatsBundle(String name, Map<String, ImageFormat> formats, ImageFormat baseFormat) {
this.name = name;
this.baseFormat = baseFormat;
this.original = new OriginalFormat(this.name, this.baseFormat);
formats.put(name, this.original);
this.formats = formats;
}
public Map<String, ImageFormat> getFormats() {
return formats;
}
public ImageFormat getBaseFormat() {
return baseFormat;
}
public String getName() {
return name;
}
public ImageFormat getOriginal() {
return original;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public String getFormatFilename(ImageFormat format) {
return (version != null && version > 0 ? format.getVersionedFilename(version) : format.getFilename());
}
}