25 lines
478 B
Java
25 lines
478 B
Java
package de.arminwolf.financeanalyzer.service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
@Service
|
|
public class CacheService {
|
|
|
|
private final Map<String, Object> cache = new HashMap<>();
|
|
|
|
|
|
public void put(final String key, final Object value) {
|
|
System.out.printf("Added to Cache. Key: [%s], Value: [%s]\n", key, value);
|
|
cache.put(key, value);
|
|
}
|
|
|
|
|
|
public Object get(final String key) {
|
|
return cache.get(key);
|
|
}
|
|
|
|
}
|