Skip to content

Commit 7c6a874

Browse files
committed
Re-define resource generic types
1 parent 4643890 commit 7c6a874

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/main/java/com/contentful/java/cda/CDAResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
public abstract class CDAResource {
99
@SerializedName("sys")
10-
Map<String, ? super Object> attrs;
10+
Map<String, ?> attrs;
1111

1212
public String id() {
1313
return getAttribute("id");
@@ -18,7 +18,7 @@ public CDAType type() {
1818
return CDAType.valueOf(type.toUpperCase(LOCALE));
1919
}
2020

21-
public Map<String, ? super Object> attrs() {
21+
public Map<String, ?> attrs() {
2222
return attrs;
2323
}
2424

src/main/java/com/contentful/java/cda/LocalizedResource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ public abstract class LocalizedResource extends CDAResource {
88

99
String defaultLocale;
1010

11-
Map<String, ? super Object> fields;
11+
Map<String, ?> fields;
1212

13-
Map<String, ? super Object> rawFields;
13+
Map<String, ?> rawFields;
1414

1515
/**
1616
* Extracts a field from the fields set of the active locale, result type is inferred.
@@ -32,7 +32,7 @@ public <T> T getField(String key) {
3232
}
3333

3434
/** Raw unprocessed fields. */
35-
public Map<String, ? super Object> rawFields() {
35+
public Map<String, ?> rawFields() {
3636
return rawFields;
3737
}
3838

src/main/java/com/contentful/java/cda/ResourceUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static void mergeIncludes(CDAArray array) {
9999
static void resolveArrayOfLinks(CDAEntry entry, CDAField field, ArrayResource array) {
100100
CDAType linkType =
101101
CDAType.valueOf(((String) field.items().get("linkType")).toUpperCase(LOCALE));
102-
Map<String, ? super Object> value = (Map) entry.fields.get(field.id());
102+
Map<String, Object> value = (Map) entry.fields.get(field.id());
103103
if (value == null) {
104104
return;
105105
}
@@ -126,7 +126,7 @@ static void resolveArrayOfLinks(CDAEntry entry, CDAField field, ArrayResource ar
126126
@SuppressWarnings("unchecked")
127127
static void resolveSingleLink(CDAEntry entry, CDAField field, ArrayResource array) {
128128
CDAType linkType = CDAType.valueOf(field.linkType().toUpperCase(LOCALE));
129-
Map<String, ? super Object> value = (Map) entry.fields.get(field.id());
129+
Map<String, Object> value = (Map) entry.fields.get(field.id());
130130
if (value == null) {
131131
return;
132132
}
@@ -237,13 +237,13 @@ static void localize(LocalizedResource resource, CDASpace space) {
237237
}
238238

239239
static void normalizeFields(LocalizedResource resource) {
240-
Map<String, ? super Object> fields = new HashMap<String, Object>();
240+
Map<String, Object> fields = new HashMap<String, Object>();
241241
for (String key : resource.fields.keySet()) {
242242
Object value = resource.fields.get(key);
243243
if (value == null) {
244244
continue;
245245
}
246-
Map<String, ? super Object> map = new HashMap<String, Object>();
246+
Map<String, Object> map = new HashMap<String, Object>();
247247
map.put(resource.locale(), value);
248248
fields.put(key, map);
249249
}
@@ -261,9 +261,9 @@ static void setRawFields(ArrayResource array) {
261261

262262
@SuppressWarnings("unchecked")
263263
private static void setRawFields(LocalizedResource resource) {
264-
Map<String, ? super Object> rawFields = new HashMap<String, Object>();
264+
Map<String, Object> rawFields = new HashMap<String, Object>();
265265
for (String key : resource.fields.keySet()) {
266-
Map<String, ? super Object> map = new HashMap<String, Object>();
266+
Map<String, Object> map = new HashMap<String, Object>();
267267
map.putAll((Map) resource.fields.get(key));
268268
rawFields.put(key, map);
269269
}

0 commit comments

Comments
 (0)