I am trying to implement a storage system in a thing I am doing, and I have run into a curious problem:
Here is part of my StorageGroup
class, its purpose is to handle values in transit between database and memory
public final class StorageGroup<T> {
@Getter private Map<String, StorageValue> data;
@Getter private String key;
public StorageGroup(String key) {
this(key, new HashMap<>());
}
private StorageGroup(String key, Map<String, StorageValue> data) {
this.data = data;
this.key = key;
}...
The important thing here is the @Getter private Map<String, StorageValue> data;
, the @Getter
annotation is from Lombok, I use it to generate getters and setters without the mess. The problem is that when I try to use STORAGEGROUPINSTANCE.getData().forEach()
, it does this:
I have to cast the two Objects in the BiConsumer to String and StorageGroup respectively, and when I try to do this:
I just get an error. What gives?
I'm not quite sure how this is a raw type problem, because I explicitly defined the types here: @Getter private Map<String, StorageValue> data;