Removed stream usage from PunishmentHolder.
This commit is contained in:
parent
b4c8bb7bfc
commit
834387f340
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -48,10 +48,8 @@ public class PunishmentHolder
|
||||
public void stopPunishment(PunishmentTask task)
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
if (!_holder.containsKey(key))
|
||||
if (_holder.containsKey(key))
|
||||
{
|
||||
return;
|
||||
}
|
||||
task.stopPunishment();
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(task.getType());
|
||||
@ -60,6 +58,7 @@ public class PunishmentHolder
|
||||
_holder.remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key
|
||||
@ -78,6 +77,10 @@ public class PunishmentHolder
|
||||
*/
|
||||
public PunishmentTask getPunishment(String key, PunishmentType type)
|
||||
{
|
||||
return _holder.containsKey(key) ? _holder.get(key).get(type) : null;
|
||||
if (_holder.containsKey(key))
|
||||
{
|
||||
return _holder.get(key).get(type);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -48,10 +48,8 @@ public class PunishmentHolder
|
||||
public void stopPunishment(PunishmentTask task)
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
if (!_holder.containsKey(key))
|
||||
if (_holder.containsKey(key))
|
||||
{
|
||||
return;
|
||||
}
|
||||
task.stopPunishment();
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(task.getType());
|
||||
@ -60,6 +58,7 @@ public class PunishmentHolder
|
||||
_holder.remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key
|
||||
@ -78,6 +77,10 @@ public class PunishmentHolder
|
||||
*/
|
||||
public PunishmentTask getPunishment(String key, PunishmentType type)
|
||||
{
|
||||
return _holder.containsKey(key) ? _holder.get(key).get(type) : null;
|
||||
if (_holder.containsKey(key))
|
||||
{
|
||||
return _holder.get(key).get(type);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -48,10 +48,8 @@ public class PunishmentHolder
|
||||
public void stopPunishment(PunishmentTask task)
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
if (!_holder.containsKey(key))
|
||||
if (_holder.containsKey(key))
|
||||
{
|
||||
return;
|
||||
}
|
||||
task.stopPunishment();
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(task.getType());
|
||||
@ -60,6 +58,7 @@ public class PunishmentHolder
|
||||
_holder.remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key
|
||||
@ -78,6 +77,10 @@ public class PunishmentHolder
|
||||
*/
|
||||
public PunishmentTask getPunishment(String key, PunishmentType type)
|
||||
{
|
||||
return _holder.containsKey(key) ? _holder.get(key).get(type) : null;
|
||||
if (_holder.containsKey(key))
|
||||
{
|
||||
return _holder.get(key).get(type);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,8 +37,7 @@ public class PunishmentHolder
|
||||
{
|
||||
if (!task.isExpired())
|
||||
{
|
||||
final String key = String.valueOf(task.getKey());
|
||||
_holder.computeIfAbsent(key, k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
_holder.computeIfAbsent(String.valueOf(task.getKey()), k -> new ConcurrentHashMap<>()).put(task.getType(), task);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,17 +62,22 @@ public class PunishmentHolder
|
||||
|
||||
public void stopPunishment(PunishmentType type)
|
||||
{
|
||||
_holder.values().stream().flatMap(p -> p.values().stream()).filter(p -> p.getType() == type).forEach(t ->
|
||||
for (Map<PunishmentType, PunishmentTask> punishments : _holder.values())
|
||||
{
|
||||
t.stopPunishment();
|
||||
final String key = String.valueOf(t.getKey());
|
||||
final Map<PunishmentType, PunishmentTask> punishments = _holder.get(key);
|
||||
punishments.remove(t.getType());
|
||||
for (PunishmentTask task : punishments.values())
|
||||
{
|
||||
if (task.getType() == type)
|
||||
{
|
||||
task.stopPunishment();
|
||||
final String key = String.valueOf(task.getKey());
|
||||
punishments.remove(task.getType());
|
||||
if (punishments.isEmpty())
|
||||
{
|
||||
_holder.remove(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user