Code example for SoftReference

Methods: get

0
 
	private static Field[] getFieldsFromCache(Class<?> clazz) {
		SoftReference<Field[]> softReferenceFields = fieldsCache.get(clazz);
		Field[] fields = null;
		if (softReferenceFields != null) {
			fields = softReferenceFields.get();
		} 
		return fields;
	} 
 
	private static void putFieldsIntoCache(Class<?> clazz, Field[] fields) {
		fieldsCache.put(clazz, new SoftReference<Field[]>(fields));
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE