private <T extends MetadataItem> PartialList<Metadata> getMetadatas( int offset, int size, String sortBy, Class<T> clazz) { PartialList<T> items = persistenceService.getAllItems(clazz, offset, size, sortBy); List<Metadata> details = new LinkedList<>(); for (T definition : items.getList()) { details.add(definition.getMetadata()); } return new PartialList<>(details, items.getOffset(), items.getPageSize(), items.getTotalSize()); }
public PartialList<Metadata> getSegmentMetadatas( String scope, int offset, int size, String sortBy) { PartialList<Segment> segments = persistenceService.query("metadata.scope", scope, sortBy, Segment.class, offset, size); List<Metadata> details = new LinkedList<>(); for (Segment definition : segments.getList()) { details.add(definition.getMetadata()); } return new PartialList<>( details, segments.getOffset(), segments.getPageSize(), segments.getTotalSize()); }
private <T extends MetadataItem> PartialList<Metadata> getMetadatas(Query query, Class<T> clazz) { if (query.isForceRefresh()) { persistenceService.refresh(); } definitionsService.resolveConditionType(query.getCondition()); PartialList<T> items = persistenceService.query( query.getCondition(), query.getSortby(), clazz, query.getOffset(), query.getLimit()); List<Metadata> details = new LinkedList<>(); for (T definition : items.getList()) { details.add(definition.getMetadata()); } return new PartialList<>(details, items.getOffset(), items.getPageSize(), items.getTotalSize()); }