本文整理汇总了Java中io.vavr.collection.HashMap.empty方法的典型用法代码示例。如果您正苦于以下问题:Java HashMap.empty方法的具体用法?Java HashMap.empty怎么用?Java HashMap.empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.vavr.collection.HashMap
的用法示例。
在下文中一共展示了HashMap.empty方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: diff
import io.vavr.collection.HashMap; //导入方法依赖的package包/类
public static Map<Phase, Vector<Patch>> diff(Option<VNode> a, Option<VNode> b) {
if (!a.isEmpty() && b.isEmpty()) {
LOG.error("Tried to remove root node");
return HashMap.empty();
}
final Map<Phase, Vector<Patch>> patches;
if (a.isEmpty()) {
patches = b.isEmpty() ? HashMap.empty() : HashMap.of(Phase.STRUCTURE, Vector.of(new UpdateRootPatch(b.get())));
} else {
patches = doDiff(Vector.empty(), a.get(), b.get());
}
LOG.trace("Diff:\na:\n{}\nb:\n{}\nresult:\n{}", a, b, patches);
return patches;
}
示例2: getValidSubTags
import io.vavr.collection.HashMap; //导入方法依赖的package包/类
private Map<QName,XSParticle> getValidSubTags(XSElementDeclaration elmt) {
if (!(elmt.getTypeDefinition() instanceof XSComplexTypeDefinition)) {
return HashMap.empty();
}
XSComplexTypeDefinition type = (XSComplexTypeDefinition) elmt.getTypeDefinition();
if (type.getParticle() == null || !(type.getParticle().getTerm() instanceof XSModelGroup)) {
return HashMap.empty();
}
XSModelGroup group = (XSModelGroup) type.getParticle().getTerm();
if (group.getCompositor() != XSModelGroup.COMPOSITOR_SEQUENCE && group.getCompositor() != XSModelGroup.COMPOSITOR_CHOICE) {
return HashMap.empty();
}
// We don't care whether it's SEQUENCE or CHOICE, we only want to know what are the valid sub-elements at this level.
XSObjectList particles = group.getParticles();
Map<QName,XSParticle> content = HashMap.empty();
for (int j = 0; j < particles.getLength(); j++) {
XSParticle sub = (XSParticle) particles.get(j);
if (sub.getTerm() instanceof XSElementDeclaration) {
XSElementDeclaration term = (XSElementDeclaration) sub.getTerm();
content = content.put(new QName(term.getNamespace(), term.getName()), sub);
}
}
return content;
}
示例3: empty
import io.vavr.collection.HashMap; //导入方法依赖的package包/类
/**
* Returns a new, empty, {@link ACL} which will use this ACLBuilder to resolve changes.
*/
public ACL<R,C> empty() {
return new ACL<>(this, HashMap.empty());
}
示例4: AttributesPatch
import io.vavr.collection.HashMap; //导入方法依赖的package包/类
public AttributesPatch(Vector<Object> path, String name, VProperty property) {
this(path, HashMap.of(name, property), HashMap.empty());
}
示例5: StagesBuilder
import io.vavr.collection.HashMap; //导入方法依赖的package包/类
public StagesBuilder(Array<VNode> children) {
super(Stages.class, HashMap.of(CHILDREN, children), HashMap.empty(), HashMap.empty(), HashMap.empty());
}
示例6: emptyMap
import io.vavr.collection.HashMap; //导入方法依赖的package包/类
@Override
<K, V> Map<K, V> emptyMap() {
return HashMap.empty();
}
示例7: VavrMapBuilder
import io.vavr.collection.HashMap; //导入方法依赖的package包/类
VavrMapBuilder() {
super(HashMap.empty(), map -> map::put, VavrMap::new);
}
示例8: SocketIOSessions
import io.vavr.collection.HashMap; //导入方法依赖的package包/类
public SocketIOSessions() {
sessions = HashMap.empty();
}