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