/** * Utility method to mark a <code>Tag</code> as parent by setting the state to * {@link TagState#PARENT}. */ private void markParent() { if (state.equals(TagState.LEAF)) { state = TagState.PARENT; } }
/** * {@inheritDoc} */ @Override public int hashCode() { final int prime = 31; int result = 1; result = (prime * result) + ((this.parent == null) ? 0 : this.parent.hashCode()); result = (prime * result) + ((this.state == null) ? 0 : this.state.hashCode()); result = (prime * result) + ((this.type == null) ? 0 : this.type.hashCode()); result = (prime * result) + ((this.value == null) ? 0 : this.value.hashCode()); return result; }
/** * {@inheritDoc} */ @Override public Multimap<String, Tag> mapTags(TagState state) { Multimap<String, Tag> tags = ArrayListMultimap.create(); for (Map.Entry<String, RuleOutput> entry : allOutputs.entries()) { if (entry.getValue().hasResultTags()) { for (Tag tag : entry.getValue().getTags()) { if (tag.getState().equals(state)) { tags.put(tag.getType(), tag); } } } } return tags; }