本文整理汇总了Java中javax.cache.processor.MutableEntry.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java MutableEntry.getValue方法的具体用法?Java MutableEntry.getValue怎么用?Java MutableEntry.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.cache.processor.MutableEntry
的用法示例。
在下文中一共展示了MutableEntry.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
@Override public Object process(MutableEntry<BinaryObject, BinaryObject> entry,
Object... arguments) throws EntryProcessorException {
BinaryObject val = entry.getValue();
/** The message will be printed on the node that stores the entry! */
System.out.println(">> Before update:");
System.out.println(val);
if (increase)
val = val.toBuilder().setField("POPULATION", (int)val.field("POPULATION") + delta).build();
else
val = val.toBuilder().setField("POPULATION", (int)val.field("POPULATION") - delta).build();
entry.setValue(val);
return entry;
}
示例2: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public IgfsEntryInfo process(MutableEntry<IgniteUuid, IgfsEntryInfo> entry, Object... args)
throws EntryProcessorException {
IgfsEntryInfo oldInfo = entry.getValue();
Map<String, String> tmp = oldInfo.properties();
tmp = tmp == null ? new GridLeanMap<String, String>(props.size()) : new GridLeanMap<>(tmp);
for (Map.Entry<String, String> e : props.entrySet()) {
if (e.getValue() == null)
// Remove properties with 'null' values.
tmp.remove(e.getKey());
else
// Add/overwrite property.
tmp.put(e.getKey(), e.getValue());
}
IgfsEntryInfo newInfo = oldInfo.properties(tmp);
entry.setValue(newInfo);
return newInfo;
}
示例3: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Long process(MutableEntry<GridCacheQueueHeaderKey, GridCacheQueueHeader> e, Object... args) {
GridCacheQueueHeader hdr = e.getValue();
boolean rmvd = queueRemoved(hdr, id);
if (rmvd || !spaceAvailable(hdr, size))
return rmvd ? QUEUE_REMOVED_IDX : null;
GridCacheQueueHeader newHdr = new GridCacheQueueHeader(hdr.id(),
hdr.capacity(),
hdr.collocated(),
hdr.head(),
hdr.tail() + size,
hdr.removedIndexes());
e.setValue(newHdr);
return hdr.tail();
}
示例4: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Long process(MutableEntry<String, Long> entry,
Object... arguments) throws EntryProcessorException {
long newVal = entry.getValue() == null ? 0 : entry.getValue() + 1;
entry.setValue(newVal);
return newVal;
}
示例5: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public V process(MutableEntry<K, V> entry, Object... arguments) {
entry.setValue(value);
return entry.getValue();
}
示例6: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Long process(MutableEntry<GridCacheInternalKey, GridCacheAtomicLongValue> e, Object... args) {
GridCacheAtomicLongValue val = e.getValue();
if (val == null)
throw new EntryProcessorException("Failed to find atomic long: " + e.getKey().name());
long curVal = val.get();
if (curVal == expVal)
e.setValue(new GridCacheAtomicLongValue(newVal));
return curVal;
}
示例7: 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;
}
示例8: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Boolean process(MutableEntry<String, BinaryObject> entry,
Object... arguments) throws EntryProcessorException {
BinaryObject val = entry.getValue();
return true;
}
示例9: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Boolean process(MutableEntry<String, CacheDeploymentTestValue> entry,
Object... arguments) throws EntryProcessorException {
CacheDeploymentTestValue val = entry.getValue();
return true;
}
示例10: 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;
}
示例11: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Integer process(MutableEntry<String, Integer> entry, Object... arguments) {
Integer currVal = entry.getValue();
if (currVal == null)
entry.setValue(0);
else
entry.setValue(currVal + 1);
return null;
}
示例12: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Integer process(MutableEntry<Integer, Integer> e, Object... args) {
Integer old = e.getValue();
e.setValue(val);
return old == null ? 0 : old;
}
示例13: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
public Void process(MutableEntry<IgfsBlockKey, byte[]> entry, Object... args)
throws EntryProcessorException {
byte[] curVal = entry.getValue();
if (curVal == null || newVal.length > curVal.length)
entry.setValue(newVal);
return null;
}
示例14: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public Void process(MutableEntry<GridCacheInternalKey, GridCacheAtomicStampedValue<T, S>> e,
Object... args) {
GridCacheAtomicStampedValue val = e.getValue();
if (val == null)
throw new EntryProcessorException("Failed to find atomic stamped with given name: " + e.getKey().name());
e.setValue(new GridCacheAtomicStampedValue<>(newVal, newStamp));
return null;
}
示例15: process
import javax.cache.processor.MutableEntry; //导入方法依赖的package包/类
@Override
public Object process(MutableEntry<Object, Object> entry, Object... arguments) throws EntryProcessorException {
return "processor-" + entry.getValue();
}