All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.xethh.libs.toolkits.stopWatchEx.StopWatchExWithLoggerFactory Maven / Gradle / Ivy

The newest version!
package me.xethh.libs.toolkits.stopWatchEx;

import me.xethh.libs.toolkits.cache.LRUCache;
import org.slf4j.Logger;

import java.util.function.Supplier;

public class StopWatchExWithLoggerFactory {
    public StopWatchExWithLoggerFactory(Logger logger, Supplier stopWatchExSupplier){
        this(logger, stopWatchExSupplier, 5,5);
    }
    public StopWatchExWithLoggerFactory(Logger logger, Supplier stopWatchExSupplier, int init, int maxEntry){
        this.builder = stopWatchExSupplier;
        cache = new LRUCache.LRUMap<>(init, maxEntry);
    }

    private Supplier builder;
    private Logger logger;
    public StopWatchEx getNewOne(){
        return builder.get();
    }

    private LRUCache.LRUMap cache;
    public static StopWatchExWithLoggerFactory getWithLabel(Logger logger, Supplier builder, int init, int maxEntry){
        return new StopWatchExWithLoggerFactory(logger, builder, init, maxEntry);
    }
    public static StopWatchExWithLoggerFactory getWithLabel(Logger logger, Supplier builder){
        return new StopWatchExWithLoggerFactory(logger, builder);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy