本文整理汇总了Java中javax.cache.processor.MutableEntry.exists方法的典型用法代码示例。如果您正苦于以下问题:Java MutableEntry.exists方法的具体用法?Java MutableEntry.exists怎么用?Java MutableEntry.exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.cache.processor.MutableEntry
的用法示例。
在下文中一共展示了MutableEntry.exists方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Boolean process(MutableEntry<Object, Object> entry, Object... arguments)
throws EntryProcessorException {
if (!entry.exists())
return null; // Someone got ahead of us and removed this entry, let's skip it.
Object entryVal = entry.getValue();
if (entryVal == null)
return null;
// Something happened to the cache while we were performing map-reduce.
if (!F.eq(entryVal, val))
return false;
entryModifier.apply(entry);
return null; // To leave out only erroneous keys - nulls are skipped on results' processing.
}
示例2: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object process(MutableEntry<Object, Object> entry, Object... args) {
if (!entry.exists()) {
failed = true;
fail();
}
Integer val = (Integer)entry.getValue();
if (!val.equals(entry.getKey())) {
failed = true;
assertEquals(val, entry.getKey());
}
entry.setValue(val + 1);
return val;
}
示例3: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Integer process(MutableEntry<Integer, Integer> e,
Object... arguments) throws EntryProcessorException {
Ignite ignite = e.unwrap(Ignite.class);
assertNotNull(ignite);
if (e.exists()) {
Integer val = e.getValue();
assertNotNull(val);
e.setValue(val + 1);
assertTrue(e.exists());
assertEquals(val + 1, (int) e.getValue());
return val;
}
else {
e.setValue(1);
return -1;
}
}
示例4: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Object process(MutableEntry<QueryTestKey, QueryTestValue> entry, Object... arguments)
throws EntryProcessorException {
if (entry.exists())
entry.setValue(new QueryTestValue(entry.getValue().val1 + 1));
else
entry.setValue(new QueryTestValue(0));
return null;
}
示例5: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
@Override public Void process(MutableEntry<String, Integer> e, Object... args) {
if (!e.exists())
e.setValue(1);
else
e.setValue(e.getValue() + 1);
return null;
}