/** * Gets the {@link Set} of tags associated with this vertex. */ default Set<String> getTags() { TagSetModel tagSetModel = getTagModel(); if (tagSetModel == null) return Collections.emptySet(); return tagSetModel.getTags(); }
/** * This essentially ensures that we only store a single Vertex for each unique "Set" of tags. */ public TagSetModel getOrCreate(GraphRewrite event, Set<String> tags) { Map<Set<String>, Vertex> cache = getCache(event); Vertex vertex = cache.get(tags); if (vertex == null) { TagSetModel model = create(); model.setTags(tags); cache.put(tags, model.getElement()); return model; } else { return frame(vertex); } } }
/** * Gets the {@link Set} of tags associated with this vertex. */ default Set<String> getTags() { TagSetModel tagSetModel = getTagModel(); if (tagSetModel == null) return Collections.emptySet(); return tagSetModel.getTags(); }
/** * This essentially ensures that we only store a single Vertex for each unique "Set" of tags. */ public TagSetModel getOrCreate(GraphRewrite event, Set<String> tags) { Map<Set<String>, Vertex> cache = getCache(event); Vertex vertex = cache.get(tags); if (vertex == null) { TagSetModel model = create(); model.setTags(tags); cache.put(tags, model.getElement()); return model; } else { return frame(vertex); } } }