PTiffMetadataImpl.java
1.81 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
55
56
57
58
59
60
61
62
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.cq.dam.dm.process.api.PTiffMetadata
* org.apache.sling.api.resource.ValueMap
* org.apache.sling.api.wrappers.ValueMapDecorator
* org.jetbrains.annotations.NotNull
*/
package com.adobe.cq.dam.dm.process.image;
import com.adobe.cq.dam.dm.process.api.PTiffMetadata;
import java.util.Map;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.api.wrappers.ValueMapDecorator;
import org.jetbrains.annotations.NotNull;
class PTiffMetadataImpl
implements PTiffMetadata {
@NotNull
private final ValueMap props;
public static boolean isPTiffMetadata(@NotNull Map<String, Object> metadata) {
return metadata.containsKey("ptiff.original") && metadata.containsKey("ptiff.width") && metadata.containsKey("ptiff.height");
}
@NotNull
public static PTiffMetadata createPTiffMetadata(@NotNull Map<String, Object> metadata) {
return new PTiffMetadataImpl((ValueMap)new ValueMapDecorator(metadata));
}
@NotNull
public static PTiffMetadata createPTiffMetadata(@NotNull ValueMap metadata) {
return new PTiffMetadataImpl(metadata);
}
public boolean isOriginal() {
return (Boolean)this.props.get("ptiff.original", Boolean.class);
}
public boolean hasSize() {
return this.props.containsKey((Object)"ptiff.width") && this.props.containsKey((Object)"ptiff.height");
}
public int getWidth() {
return (Integer)this.props.get("ptiff.width", Integer.class);
}
public int getHeight() {
return (Integer)this.props.get("ptiff.height", Integer.class);
}
@NotNull
public ValueMap getProps() {
return this.props;
}
private PTiffMetadataImpl(@NotNull ValueMap metadata) {
this.props = metadata;
}
}