@Test void buildFromEmptyBundle_noEncass() { EncassEntityBuilder builder = new EncassEntityBuilder(ID_GENERATOR); final List<Entity> entities = builder.build(new Bundle(), BundleType.DEPLOYMENT, DocumentTools.INSTANCE.getDocumentBuilder().newDocument()); assertTrue(entities.isEmpty()); }
public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { AnnotatedBundle annotatedBundle = ((AnnotatedBundle) bundle); Map<String, Encass> map = Optional.ofNullable(annotatedBundle.getEncasses()).orElse(Collections.emptyMap()); return buildEntities(map, annotatedBundle, annotatedBundle.getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getEncasses(), null, bundle, bundleType, document); } }
EncassEntityBuilder implements EntityBuilder { public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { AnnotatedBundle annotatedBundle = ((AnnotatedBundle) bundle); Map<String, Encass> map = Optional.ofNullable(annotatedBundle.getEncasses()).orElse(Collections.emptyMap()); return buildEntities(map, annotatedBundle, annotatedBundle.getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getEncasses(), null, bundle, bundleType, document); } } }
EncassEntityBuilder implements EntityBuilder { public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { AnnotatedBundle annotatedBundle = ((AnnotatedBundle) bundle); Map<String, Encass> map = Optional.ofNullable(annotatedBundle.getEncasses()).orElse(Collections.emptyMap()); return buildEntities(map, annotatedBundle, annotatedBundle.getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getEncasses(), null, bundle, bundleType, document); } } @Inject  EncassEntityBuilder(IdGenerator idGenerator); }
EncassEntityBuilder implements EntityBuilder { public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { AnnotatedBundle annotatedBundle = ((AnnotatedBundle) bundle); Map<String, Encass> map = Optional.ofNullable(annotatedBundle.getEncasses()).orElse(Collections.emptyMap()); return buildEntities(map, annotatedBundle, annotatedBundle.getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getEncasses(), null, bundle, bundleType, document); } } @Inject  EncassEntityBuilder(IdGenerator idGenerator); List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @NotNull @Override Integer getOrder(); }
EncassEntityBuilder implements EntityBuilder { public List<Entity> build(Bundle bundle, BundleType bundleType, Document document) { if (bundle instanceof AnnotatedBundle) { AnnotatedBundle annotatedBundle = ((AnnotatedBundle) bundle); Map<String, Encass> map = Optional.ofNullable(annotatedBundle.getEncasses()).orElse(Collections.emptyMap()); return buildEntities(map, annotatedBundle, annotatedBundle.getFullBundle(), bundleType, document); } else { return buildEntities(bundle.getEncasses(), null, bundle, bundleType, document); } } @Inject  EncassEntityBuilder(IdGenerator idGenerator); List<Entity> build(Bundle bundle, BundleType bundleType, Document document); @NotNull @Override Integer getOrder();  }