本文整理汇总了Java中javax.cache.processor.MutableEntry.remove方法的典型用法代码示例。如果您正苦于以下问题:Java MutableEntry.remove方法的具体用法?Java MutableEntry.remove怎么用?Java MutableEntry.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.cache.processor.MutableEntry
的用法示例。
在下文中一共展示了MutableEntry.remove方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Void process(MutableEntry<HadoopJobId, HadoopJobMetadata> e, Object... args) {
HadoopJobMetadata val = apply(e.getValue());
if (val != null)
e.setValue(val);
else
e.remove();
return null;
}
示例2: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object process(MutableEntry<Object, Object> entry, Object... arguments) {
Object oldVal = entry.getValue();
entry.remove();
return oldVal;
}
示例3: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object process(MutableEntry<Object, Object> e, Object... args) {
Object old = retOld ? e.getValue() : null;
if (val != null)
e.setValue(val);
else
e.remove();
return old;
}
示例4: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object process(MutableEntry<Object, Object> e, Object... args) {
if (skipModify)
return null;
Object old = retOld ? e.getValue() : null;
if (val != null)
e.setValue(val);
else
e.remove();
return old;
}
示例5: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Integer process(MutableEntry<Integer, Integer> e,
Object... arguments) throws EntryProcessorException {
assertTrue(e.exists());
if (expVal != null)
assertEquals(expVal, e.getValue());
e.remove();
assertFalse(e.exists());
return null;
}
示例6: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Integer process(MutableEntry<Integer, Integer> entry, Object... arguments) {
Integer val = entry.getValue();
if (newVal == null)
entry.remove();
else
entry.setValue(newVal);
return val;
}
示例7: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Integer process(
final MutableEntry<Integer, Integer> entry,
final Object... arguments
) throws EntryProcessorException {
entry.remove();
return null;
}
示例8: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object process(MutableEntry<Long, String> entry, Object... args) {
long key = entry.getKey();
if (key % 2 == 0)
entry.remove();
else
entry.setValue(entry.getValue() + "-");
return null;
}
示例9: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
@Override
public T process(MutableEntry<K, V> entry, Object... arguments) {
T result = null;
if (assertExists) {
assertTrue(entry.exists());
result = (T)entry.getValue();
}
entry.remove();
assertFalse(entry.exists());
return result;
}
示例10: testInvoke
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
@Test
public void testInvoke()
{
final CacheLoader<String, Integer> cacheLoader = new CacheLoader<String, Integer>()
{
@Override
public Integer load(String key)
throws CacheLoaderException
{
return Integer.valueOf(key);
}
@Override
public Map<String, Integer> loadAll(Iterable<? extends String> keys)
throws CacheLoaderException
{
throw new UnsupportedOperationException("Not supported yet.");
}
};
final EntryProcessor<String, Integer, Boolean> entryProcessor = new EntryProcessor<String, Integer, Boolean>()
{
@Override
public Boolean process(MutableEntry<String, Integer> entry, Object... arguments)
throws EntryProcessorException
{
assertTrue(entry.exists());
assertEquals(Integer.valueOf(1), entry.getValue());
entry.setValue(2);
assertEquals(Integer.valueOf(2), entry.getValue());
entry.remove();
assertFalse(entry.exists());
return Boolean.TRUE;
}
};
MutableConfiguration<String, Integer> custom = new MutableConfiguration<>(configuration);
custom.setReadThrough(true);
custom.setCacheLoaderFactory
(
new Factory<CacheLoader<String, Integer>>()
{
@Override
public CacheLoader<String, Integer> create()
{
return cacheLoader;
}
}
);
Cache<String, Integer> invokingCache = cacheManager.createCache("invokingCache", custom);
assertTrue(invokingCache.invoke("1", entryProcessor));
assertFalse(invokingCache.containsKey("1"));
}
示例11: apply
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void apply(MutableEntry<Object, Object> e) {
e.remove();
}
示例12: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object process(MutableEntry<Object, Object> e, Object... args) {
e.remove();
return null;
}
示例13: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
@Override public Void process(MutableEntry<String, Integer> e, Object... args) {
e.remove();
return null;
}
示例14: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Integer process(MutableEntry<String, Integer> e, Object... args) {
e.remove();
return null;
}