
com.github.ydoc.plugin.mc.McStore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ydoc-spring-boot-starter Show documentation
Show all versions of ydoc-spring-boot-starter Show documentation
YDoc一款低侵入性、简洁并同时支持SwaggerUi和YApi的文档生成器
The newest version!
package com.github.ydoc.plugin.mc;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.atomic.LongAdder;
/**
* @author nobugboy
**/
public class McStore extends LinkedHashMap>> {
public static final McStore MC_STORE = new McStore();
public static final LongAdder LONG_ADDER = new LongAdder();
public synchronized void add(List> data) {
LONG_ADDER.increment();
if (LONG_ADDER.longValue() > 50) {
MC_STORE.remove(LONG_ADDER.longValue() - 50);
}
MC_STORE.put(LONG_ADDER.longValue(), data);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy