private void linkItem(final LinkedSpecificationItem item) { for (final SpecificationItemId id : item.getCoveredIds()) { linkItemToItemWithId(item, id); } }
/** * Get the artifact types in which this item needs to be covered. * * @return list of artifact types. */ public List<String> getNeedsArtifactTypes() { return this.getItem().getNeedsArtifactTypes(); }
/** * Get the ID of the items this {@link LinkedSpecificationItem} covers. * * @return the list of IDs */ public List<SpecificationItemId> getCoveredIds() { return this.getItem().getCoveredIds(); }
private LinkedSpecificationItem findOrCreateStaleItem(final SpecificationItemId id) { this.staleIndex.computeIfAbsent(id, key -> new LinkedSpecificationItem(SpecificationItem.builder().id(id).build())); return this.staleIndex.get(id); }
private void linkItemToItemWithId(final LinkedSpecificationItem item, final SpecificationItemId id) { LinkedSpecificationItem coveredLinkedItem; if ((coveredLinkedItem = this.index.getById(id)) != null) { linkMatchingRevision(item, coveredLinkedItem); } else { linkOrphanToStaleId(item, id); linkIgnoringRevision(item, id); } }
/** * Get the revision of the specification item * * @return revision */ public int getRevision() { return this.id.getRevision(); }
private void linkOrphanToStaleId(final LinkedSpecificationItem item, final SpecificationItemId id) { final LinkedSpecificationItem deadItem = findOrCreateStaleItem(id); item.addLinkToItemWithStatus(deadItem, LinkStatus.ORPHANED); }
/** * Get the tags associated with this item. * * @return list of tags */ public List<String> getTags() { return this.item.getTags(); }
/** * @return <code>true</code> if the link originates at the other end */ public boolean isIncoming() { return this.status.isIncoming(); }
@Override public void beginSpecificationItem() { this.itemBuilder = SpecificationItem.builder(); }
/** * Check if the link is an incoming link. * * @return <code>true</code> if the link is incoming. */ public boolean isIncoming() { return (this == COVERED_SHALLOW) || isBadIncoming(); }
/** * Get the ID of the specification item. * * @return ID of the specification item */ public SpecificationItemId getId() { return this.item.getId(); }
@Override public void setTitle(final String title) { this.itemBuilder.title(title); }
private LinkedSpecificationItem findOrCreateStaleItem(final SpecificationItemId id) { this.staleIndex.computeIfAbsent(id, key -> new LinkedSpecificationItem(SpecificationItem.builder().id(id).build())); return this.staleIndex.get(id); }
/** * Get the artifact types in which this item needs to be covered. * * @return list of artifact types. */ public List<String> getNeedsArtifactTypes() { return this.getItem().getNeedsArtifactTypes(); }
/** * Get the ID of the items this {@link LinkedSpecificationItem} covers. * * @return the list of IDs */ public List<SpecificationItemId> getCoveredIds() { return this.getItem().getCoveredIds(); }
private void linkItem(final LinkedSpecificationItem item) { for (final SpecificationItemId id : item.getCoveredIds()) { linkItemToItemWithId(item, id); } }
private void linkOrphanToStaleId(final LinkedSpecificationItem item, final SpecificationItemId id) { final LinkedSpecificationItem deadItem = findOrCreateStaleItem(id); item.addLinkToItemWithStatus(deadItem, LinkStatus.ORPHANED); }