CompatHelper.java
2.47 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
63
64
65
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.granite.ui.clientlibs.ClientLibrary
* com.adobe.granite.ui.clientlibs.HtmlLibrary
* com.adobe.granite.ui.clientlibs.LibraryType
*/
package com.day.cq.widget.impl;
import com.day.cq.widget.ClientLibrary;
import com.day.cq.widget.HtmlLibrary;
import com.day.cq.widget.LibraryType;
import com.day.cq.widget.impl.ClientLibraryImpl;
import com.day.cq.widget.impl.HtmlLibraryImpl;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public class CompatHelper {
public static LibraryType convert(com.adobe.granite.ui.clientlibs.LibraryType type) {
String name = type == null ? null : type.name();
return name == null ? null : LibraryType.valueOf(name);
}
public static com.adobe.granite.ui.clientlibs.LibraryType convert(LibraryType type) {
String name = type == null ? null : type.name();
return name == null ? null : com.adobe.granite.ui.clientlibs.LibraryType.valueOf((String)name);
}
public static Set<LibraryType> convert(Set<com.adobe.granite.ui.clientlibs.LibraryType> types) {
HashSet<LibraryType> ret = new HashSet<LibraryType>();
for (com.adobe.granite.ui.clientlibs.LibraryType type : types) {
ret.add(LibraryType.valueOf(type.name()));
}
return ret;
}
public static Map<String, ClientLibrary> convert(Map<String, ? extends com.adobe.granite.ui.clientlibs.ClientLibrary> libs) {
LinkedHashMap<String, ClientLibrary> ret = new LinkedHashMap<String, ClientLibrary>();
for (Map.Entry<String, ? extends com.adobe.granite.ui.clientlibs.ClientLibrary> lib : libs.entrySet()) {
ret.put(lib.getKey(), new ClientLibraryImpl(lib.getValue()));
}
return ret;
}
public static HtmlLibrary convert(com.adobe.granite.ui.clientlibs.HtmlLibrary lib) {
return lib == null ? null : new HtmlLibraryImpl(lib);
}
public static Collection<ClientLibrary> convert(Collection<com.adobe.granite.ui.clientlibs.ClientLibrary> libs) {
ArrayList<ClientLibrary> ret = new ArrayList<ClientLibrary>(libs.size());
for (com.adobe.granite.ui.clientlibs.ClientLibrary lib : libs) {
ret.add(new ClientLibraryImpl(lib));
}
return ret;
}
}