本文整理汇总了Java中org.sdnplatform.sync.error.InconsistentDataException类的典型用法代码示例。如果您正苦于以下问题:Java InconsistentDataException类的具体用法?Java InconsistentDataException怎么用?Java InconsistentDataException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InconsistentDataException类属于org.sdnplatform.sync.error包,在下文中一共展示了InconsistentDataException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleGet
import org.sdnplatform.sync.error.InconsistentDataException; //导入依赖的package包/类
protected Versioned<V> handleGet(K key,
Versioned<V> defaultValue,
List<Versioned<V>> raw)
throws InconsistentDataException {
if (raw == null) return defaultValue(defaultValue);
List<Versioned<V>> vs = resolver.resolveConflicts(raw);
return getItemOrThrow(key, defaultValue, vs);
}
示例2: getItemOrThrow
import org.sdnplatform.sync.error.InconsistentDataException; //导入依赖的package包/类
protected Versioned<V> getItemOrThrow(K key,
Versioned<V> defaultValue,
List<Versioned<V>> items)
throws InconsistentDataException {
if(items.size() == 0)
return defaultValue(defaultValue);
else if(items.size() == 1)
return items.get(0);
else
throw new InconsistentDataException("Resolver failed to resolve" +
" conflict: " + items.size() + " unresolved items", items);
}
示例3: handleGet
import org.sdnplatform.sync.error.InconsistentDataException; //导入依赖的package包/类
protected Versioned<V> handleGet(K key,
Versioned<V> defaultValue,
List<Versioned<V>> raw)
throws InconsistentDataException {
if (raw == null) return defaultValue(defaultValue);
List<Versioned<V>> vs = resolver.resolveConflicts(raw);
return getItemOrThrow(key, defaultValue, vs);
}