public void addClassification(final PdcClassification classification) { if (COMPONENT_INSTANCE_ID.equals(classification.getComponentInstanceId()) && (CONTENT_ID.equals(classification.getContentId()))) { this.positions.clear(); for (ClassifyPosition position : classification.getClassifyPositions()) { addPosition(position); } } }
public PdcClassification getClassification(String contentId, String inComponentId) { PdcClassification classification = null; if (COMPONENT_INSTANCE_ID.equals(inComponentId) && CONTENT_ID.equals(contentId) && !positions.isEmpty()) { classification = aClassificationFromPositions(positions) .ofContent(contentId) .inComponentInstance(inComponentId); } return classification; }
private void assertContentExists(String contentId, String inComponentId) throws PdcException { if (!COMPONENT_INSTANCE_ID.equals(inComponentId) || !CONTENT_ID.equals(contentId)) { throw new PdcException(getClass().getSimpleName(), SilverTrace.TRACE_LEVEL_ERROR, ""); } }