Spring Framework SimpleValueWrapper - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework SimpleValueWrapper class.

This code example shows how to use the following methods:
	public void clear() { 
		this.cache.removeAll();
	} 
 
	private ValueWrapper toWrapper(Element element) {
		return (element != null ? new SimpleValueWrapper(element.getObjectValue()) : null);
	} 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
		} 
		return userValue;
	} 
 
	private ValueWrapper toWrapper(Object value) {
		return (value != null ? new SimpleValueWrapper(fromStoreValue(value)) : null);
	} 
 
 
	@SuppressWarnings("serial") 
	private static class NullHolder implements Serializable {
	} 
 
 
	private class PutIfAbsentCallable implements Callable<Object> {
 
		private final Object value;
 
		private boolean called;
 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
    public ValueWrapper get(final Object key) {
        if (key == null) {
            return null; 
        } 
        final Object value = map.get(key);
        return value != null ? new SimpleValueWrapper(fromStoreValue(value)) : null;
    } 
 
    public <T> T get(Object key, Class<T> type) {
        Object value = fromStoreValue(this.map.get(key));
        if (type != null && value != null && !type.isInstance(value)) {
            throw new IllegalStateException("Cached value is not of required type [" + type.getName() + "]: " + value);
        } 
        return (T) value;
    } 
 
    public void put(final Object key, final Object value) {
        if (key != null) {
            map.set(key, toStoreValue(value));
        } 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	} 
 
	public ValueWrapper get(final Object key) {
		Object value = region.get(key);
 
		return (value == null ? null : new SimpleValueWrapper(value));
	} 
 
	@SuppressWarnings("unchecked") 
	public <T> T get(final Object key, final Class<T> type) {
		Object value = region.get(key);
 
		if (value != null && type != null && !type.isInstance(value)) {
			throw new IllegalStateException(String.format("Cached value is not of required type [%1$s]: %2$s",
				type.getName(), value));
		} 
 
		return (T) value;
	} 
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
   * @return the fetched value from Couchbase. 
   */ 
  public final ValueWrapper get(final Object key) {
    String documentId = key.toString();
    Object result = client.get(documentId);
    return (result != null ? new SimpleValueWrapper(result) : null);
  } 
 
  @SuppressWarnings("unchecked") 
  public final <T> T get(final Object key, final Class<T> clazz) {
    String documentId = key.toString();
    return (T) client.get(documentId);
  } 
 
  /** 
   * Store a object in Couchbase. 
   * 
   * @param key the Key of the storable object. 
   * @param value the Object to store. 
   */ 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	public ValueWrapper get(Object key) { 
		if (key == null) { 
			return null; 
		} 
		final Object value = cache.get(key); 
		return value != null ? new SimpleValueWrapper(value) : null; 
	} 
 
	/* 
	 * (non-Javadoc) 
	 *  
	 * @see org.springframework.cache.Cache#put(java.lang.Object, 
	 * java.lang.Object) 
	 */ 
	public void put(Object key, Object value) { 
		cache.put(key, value); 
	} 
 
	/* 
	 * (non-Javadoc) 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
            LOGGER.info("Cache miss. Get by key {} from cache {}", key, cache.getName());
            return null; 
        } 
 
        LOGGER.info("Cache hit. Get by key {} from cache {} value '{}'", new Object[] { key, cache.getName(), value });
        return value instanceof PertinentNegativeNull ? new SimpleValueWrapper(null) : new SimpleValueWrapper(value);
    } 
 
    /** 
     * Required by Spring 4.0 
     *  
     * @since 3.4.0 
     */ 
    @SuppressWarnings("unchecked") 
    public <T> T get(Object key, Class<T> type) {
        if (!cache.isEnabled()) {
            LOGGER.warn("Cache {} is disabled. Cannot get {} from cache", cache.getName(), key);
            return null; 
        } 
 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java