Sha256: 9914f2f9c146e2f323ea70b2e3f5b88e846530a18833c39bd40cdfed454cc178
Contents?: true
Size: 737 Bytes
Versions: 15
Compression:
Stored size: 737 Bytes
Contents
package com.moode.sms.framework; import java.util.HashMap; import java.util.Map; public class CommonServiceContext { private static CommonServiceContext commonServiceContext; private Map<Class, Object> objectMap; private CommonServiceContext() { objectMap = new HashMap<Class, Object>(); } public static CommonServiceContext getInstance() { if (commonServiceContext == null) { commonServiceContext = new CommonServiceContext(); } return commonServiceContext; } public <T> void putObject(Class<T> clazz, T object) { objectMap.put(clazz, object); } public <T> T getObject(Class<T> clazz) { return (T) objectMap.get(clazz); } }
Version data entries
15 entries across 15 versions & 1 rubygems