ЕМ
Size: a a a
AG
interface Int {
Map<Int, State> STUFF = new ConcurrentHashMap<>();
default void doSmth() {
State state = STUFF.computeIfAbsent(this, k -> new State());
System.out.println(state.stateVar);
}
class State {
int stateVar;
}
}
AG
IdentityHashMap
, чтобы уж точно работало с конкретными инстансамиIP
IdentityHashMap
, чтобы уж точно работало с конкретными инстансамиAG
Collections.synchronizedMap(new IdentityHashMap<>());
AB
A
interface Int {
Map<Int, State> STUFF = new ConcurrentHashMap<>();
default void doSmth() {
State state = STUFF.computeIfAbsent(this, k -> new State());
System.out.println(state.stateVar);
}
class State {
int stateVar;
}
}
AG
V
A
Lr
DC
DC