public <B extends Blueprint> ElementTypes<? extends AbstractElement<B, ?>, B, ?> byBlueprint(Class<B> blueprintType) { for(SegmentType st : SegmentType.values()) { ElementTypes ret = elementTypes.get(st); if (ret.getBlueprintType().equals(blueprintType)) { return ret; } } throw new IllegalArgumentException("Unknown blueprint type: " + blueprintType); }
public <B extends Blueprint> ElementTypes<? extends AbstractElement, B> byBlueprint(Class<B> blueprintType) { for(SegmentType st : SegmentType.values()) { ElementTypes ret = elementTypes.get(st); if (ret.getBlueprintType().equals(blueprintType)) { return ret; } } throw new IllegalArgumentException("Unknown blueprint type: " + blueprintType); }
private boolean __correctChangesPrologue(ProcessingTree<BE> changedEntity) { if (changedEntity.cp == null) { return false; } if (!changedEntity.isSignificant()) { //fast track - this is an entity that has not been CRUD'd but is present in the tree to complete the //hierarchy DBG.debug("Entity not hash-significant. Proceeding quickly."); return false; } if (!(Entity.Blueprint.class.isAssignableFrom( Inventory.types().bySegment(changedEntity.cp.getSegment().getElementType()).getBlueprintType()))) { //this is currently the case for metadata packs, which do not have their IDs assigned by the user. //we therefore mark them as processed. DBG.debug("Metadatapacks not processable. Bailing out quickly."); return true; } try { DBG.debug("Refreshing the entity in the current transaction."); changedEntity.loadFrom(tx); } catch (ElementNotFoundException e) { //ok, we're inside a delete and the root entity no longer exists... bail out quickly... if (processDeletion(changedEntity, changedEntity.notifications)) { return true; } else { throw new EntityNotFoundException(Query.filters(Query.to(changedEntity.cp))); } } return processDeletion(changedEntity, changedEntity.notifications); }