@SuppressWarnings({"unchecked"}) public KeyedCollection(Collection<? extends V> c) { if (c instanceof KeyedCollection) { KeyedCollection keyedCollection = (KeyedCollection) c; // NOTE: if types don't match bad things could happen keyExtractor = keyedCollection.keyExtractor; } else { // NOTE: V must implement Keyable or class cast exception will be thrown on add keyExtractor = null; } map = new LinkedHashMap<K,V>(); addAll(c); }
@SuppressWarnings({"unchecked"}) public KeyedCollection(final Collection<? extends V> c) { if (c instanceof KeyedCollection) { final KeyedCollection keyedCollection = (KeyedCollection) c; // NOTE: if types don't match bad things could happen keyExtractor = keyedCollection.keyExtractor; } else { // NOTE: V must implement Keyable or class cast exception will be thrown on add keyExtractor = null; } map = new LinkedHashMap<K, V>(); addAll(c); }
@SuppressWarnings({"unchecked"}) public KeyedCollection(final Collection<? extends V> c) { if (c instanceof KeyedCollection) { final KeyedCollection keyedCollection = (KeyedCollection) c; // NOTE: if types don't match bad things could happen keyExtractor = keyedCollection.keyExtractor; } else { // NOTE: V must implement Keyable or class cast exception will be thrown on add keyExtractor = null; } map = new LinkedHashMap<K, V>(); addAll(c); }
public Map<String, RelationField> getRelationshipFieldMap() { KeyedCollection<String, RelationField> fields = new KeyedCollection<String, RelationField>(); if (oneToOne != null) fields.addAll(oneToOne); if (oneToMany != null) fields.addAll(oneToMany); if (manyToMany != null) fields.addAll(manyToMany); if (manyToOne != null) fields.addAll(manyToOne); return fields.toMap(); }
public Map<String, RelationField> getRelationshipFieldMap() { final KeyedCollection<String, RelationField> fields = new KeyedCollection<String, RelationField>(); if (oneToOne != null) fields.addAll(oneToOne); if (oneToMany != null) fields.addAll(oneToMany); if (manyToMany != null) fields.addAll(manyToMany); if (manyToOne != null) fields.addAll(manyToOne); return fields.toMap(); }
public Map<String, RelationField> getRelationshipFieldMap() { final KeyedCollection<String, RelationField> fields = new KeyedCollection<String, RelationField>(); if (oneToOne != null) fields.addAll(oneToOne); if (oneToMany != null) fields.addAll(oneToMany); if (manyToMany != null) fields.addAll(manyToMany); if (manyToOne != null) fields.addAll(manyToOne); return fields.toMap(); }
@Override public AppModule deploy(final AppModule appModule) throws OpenEJBException { final List<JndiConsumer> jndiConsumers = collectConsumers(appModule); final KeyedCollection<String, JMSDestination> destinations = new KeyedCollection<>(); for (final JndiConsumer consumer : jndiConsumers) { if (consumer != null) { destinations.addAll(consumer.getJMSDestination()); } } for (final JMSDestination destination : destinations) { appModule.getResources().add(toResource(destination)); } return appModule; }
@Override public AppModule deploy(final AppModule appModule) throws OpenEJBException { final List<JndiConsumer> jndiConsumers = collectConsumers(appModule); final KeyedCollection<String, JMSConnectionFactory> factories = new KeyedCollection<>(); for (final JndiConsumer consumer : jndiConsumers) { if (consumer != null) { factories.addAll(consumer.getJMSConnectionFactories()); } } for (final JMSConnectionFactory factory : factories) { appModule.getResources().add(toResource(factory)); } return appModule; }
@Override public AppModule deploy(final AppModule appModule) throws OpenEJBException { final List<JndiConsumer> jndiConsumers = collectConsumers(appModule); final KeyedCollection<String, DataSource> dataSources = new KeyedCollection<String, DataSource>(); for (final JndiConsumer consumer : jndiConsumers) { if (consumer == null) { continue; } dataSources.addAll(consumer.getDataSource()); } for (final DataSource dataSource : dataSources) { appModule.getResources().add(toResource(dataSource)); } return appModule; }