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