Package org.springframework.cache.support

Examples of org.springframework.cache.support.SimpleValueWrapper


    willThrow(exception).given(cache).get(0L);
    willThrow(exception).given(cache).put(0L, 0L); // Update of the cache will fail as well

    Object counter = this.simpleService.get(0L);

    willReturn(new SimpleValueWrapper(2L)).given(cache).get(0L);
    Object counter2 = this.simpleService.get(0L);
    Object counter3 = this.simpleService.get(0L);
    assertNotSame(counter, counter2);
    assertEquals(counter2, counter3);
  }
View Full Code Here


    }
    return userValue;
  }

  private ValueWrapper toWrapper(Object value) {
    return (value != null ? new SimpleValueWrapper(fromStoreValue(value)) : null);
  }
View Full Code Here

  }

  @Override
  public ValueWrapper get(Object key) {
    Object value = this.cache.get(key);
    return (value != null ? new SimpleValueWrapper(fromStoreValue(value)) : null);
  }
View Full Code Here

    }
    return userValue;
  }

  private ValueWrapper toWrapper(Object value) {
    return (value != null ? new SimpleValueWrapper(fromStoreValue(value)) : null);
  }
View Full Code Here

  public ValueWrapper get(Object key) {
    if (key == null) {
      return null;
    }
    final Object value = cache.get(key);
    return value != null ? new SimpleValueWrapper(value) : null;
  }
View Full Code Here

    * @see org.springframework.cache.Cache#get(java.lang.Object)
    */
   @Override
   public ValueWrapper get(final Object key) {
      Object v = nativeCache.get(key);
    return (v != null ? new SimpleValueWrapper(v) : null);
   }
View Full Code Here

         return null;
      }
      if (v == NullValue.NULL) {
         return NullValue.NULL;
      }
      return new SimpleValueWrapper(v);
   }
View Full Code Here

         return null;
      }
      if (v == NullValue.NULL) {
         return NullValue.NULL;
      }
      return new SimpleValueWrapper(v);
   }
View Full Code Here

  public void clear() {
    this.cache.removeAll();
  }

  private ValueWrapper toWrapper(Element element) {
    return (element != null ? new SimpleValueWrapper(element.getObjectValue()) : null);
  }
View Full Code Here

    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;
    }
View Full Code Here

TOP

Related Classes of org.springframework.cache.support.SimpleValueWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.