/** * Gets a list of entries of a particular kind. */ public <T extends BaseEntry> List<T> getEntries(Class<T> returnClass) { List<T> adaptedEntries = new ArrayList<T>(); for (BaseEntry<?> entry : getEntries()) { T adapted = entry.getAdaptor(returnClass); if (adapted != null) { adaptedEntries.add(adapted); } } return adaptedEntries; } }
/** * Gets a list of entries of a particular kind. */ public <T extends BaseEntry> List<T> getEntries(Class<T> returnClass) { List<T> adaptedEntries = new ArrayList<T>(); for (BaseEntry<?> entry : getEntries()) { T adapted = entry.getAdaptor(returnClass); if (adapted != null) { adaptedEntries.add(adapted); } } return adaptedEntries; } }
/** * Gets a list of entries of a particular kind. */ public <T extends BaseEntry> List<T> getEntries(Class<T> returnClass) { List<T> adaptedEntries = new ArrayList<T>(); for (BaseEntry<?> entry : getEntries()) { T adapted = entry.getAdaptor(returnClass); if (adapted != null) { adaptedEntries.add(adapted); } } return adaptedEntries; } }
sourceEntries.addAll(entries); adaptedFeed.getEntries().clear(); for (E entry : sourceEntries) { adaptedFeed.getEntries().add(entry.getAdaptedEntry());
sourceEntries.addAll(entries); adaptedFeed.getEntries().clear(); for (E entry : sourceEntries) { adaptedFeed.getEntries().add(entry.getAdaptedEntry());
sourceEntries.addAll(entries); adaptedFeed.getEntries().clear(); for (E entry : sourceEntries) { adaptedFeed.getEntries().add(entry.getAdaptedEntry());
/** * Sets the application attribute using the name passed to the constructor * on a batch feed. * * @param batchFeed */ @SuppressWarnings("unchecked") private void addApplicationAttribute(IFeed iFeed) { if (! (iFeed instanceof BaseFeed)) { throw new IllegalArgumentException("Unexpected feed type: " + iFeed); } BaseFeed<?, ?> batchFeed = (BaseFeed<?, ?>) iFeed; BatchOperationType defaultType = BatchUtils.getBatchOperationType(batchFeed); if (defaultType == null) { defaultType = BatchOperationType.INSERT; } List<? extends BaseEntry> entries = batchFeed.getEntries(); for (BaseEntry<?> entry: entries) { BatchOperationType type = BatchUtils.getBatchOperationType(entry); if (type == null) { type = defaultType; } if (type == BatchOperationType.INSERT || type == BatchOperationType.UPDATE) { addApplicationAttribute(entry); } } }
/** * Sets the application attribute using the name passed to the constructor * on a batch feed. * * @param batchFeed */ @SuppressWarnings("unchecked") private void addApplicationAttribute(IFeed iFeed) { if (! (iFeed instanceof BaseFeed)) { throw new IllegalArgumentException("Unexpected feed type: " + iFeed); } BaseFeed<?, ?> batchFeed = (BaseFeed<?, ?>) iFeed; BatchOperationType defaultType = BatchUtils.getBatchOperationType(batchFeed); if (defaultType == null) { defaultType = BatchOperationType.INSERT; } List<? extends BaseEntry> entries = batchFeed.getEntries(); for (BaseEntry<?> entry: entries) { BatchOperationType type = BatchUtils.getBatchOperationType(entry); if (type == null) { type = defaultType; } if (type == BatchOperationType.INSERT || type == BatchOperationType.UPDATE) { addApplicationAttribute(entry); } } }