@Test public void testConvertCount() { HitsAnalytics hitsAnalytics = new HitsAnalytics(); hitsAnalytics.setHits(1L); CountAnalytics analytics = analyticsMapper.convert(hitsAnalytics); assertNotNull(analytics); assertEquals(1, analytics.getHits().longValue()); }
public DateHistoAnalytics convert(HistogramAnalytics analytics) { DateHistoAnalytics analyticsItem = new DateHistoAnalytics(); if (analytics != null && analytics.getTimestamp() != null) { analyticsItem.setTimestamp(new Timerange() .from(analytics.getTimestamp().getFrom()) .to(analytics.getTimestamp().getTo()) .interval(analytics.getTimestamp().getInterval()) ); List<Bucket> buckets = convertBucketList(analytics.getValues()); analyticsItem.setValues(buckets); } return analyticsItem; }
AnalyticsMapper { public DateHistoAnalytics convert(HistogramAnalytics analytics) { DateHistoAnalytics analyticsItem = new DateHistoAnalytics(); if (analytics != null && analytics.getTimestamp() != null) { analyticsItem.setTimestamp(new Timerange() .from(analytics.getTimestamp().getFrom()) .to(analytics.getTimestamp().getTo()) .interval(analytics.getTimestamp().getInterval()) ); List<Bucket> buckets = convertBucketList(analytics.getValues()); analyticsItem.setValues(buckets); } return analyticsItem; } }
AnalyticsMapper { public DateHistoAnalytics convert(HistogramAnalytics analytics) { DateHistoAnalytics analyticsItem = new DateHistoAnalytics(); if (analytics != null && analytics.getTimestamp() != null) { analyticsItem.setTimestamp(new Timerange() .from(analytics.getTimestamp().getFrom()) .to(analytics.getTimestamp().getTo()) .interval(analytics.getTimestamp().getInterval()) ); List<Bucket> buckets = convertBucketList(analytics.getValues()); analyticsItem.setValues(buckets); } return analyticsItem; }  }
AnalyticsMapper { public DateHistoAnalytics convert(HistogramAnalytics analytics) { DateHistoAnalytics analyticsItem = new DateHistoAnalytics(); if (analytics != null && analytics.getTimestamp() != null) { analyticsItem.setTimestamp(new Timerange() .from(analytics.getTimestamp().getFrom()) .to(analytics.getTimestamp().getTo()) .interval(analytics.getTimestamp().getInterval()) ); List<Bucket> buckets = convertBucketList(analytics.getValues()); analyticsItem.setValues(buckets); } return analyticsItem; }  DateHistoAnalytics convert(HistogramAnalytics analytics); CountAnalytics convert(HitsAnalytics analytics); GroupByAnalytics convert(TopHitsAnalytics analytics); }
AnalyticsMapper { public DateHistoAnalytics convert(HistogramAnalytics analytics) { DateHistoAnalytics analyticsItem = new DateHistoAnalytics(); if (analytics != null && analytics.getTimestamp() != null) { analyticsItem.setTimestamp(new Timerange() .from(analytics.getTimestamp().getFrom()) .to(analytics.getTimestamp().getTo()) .interval(analytics.getTimestamp().getInterval()) ); List<Bucket> buckets = convertBucketList(analytics.getValues()); analyticsItem.setValues(buckets); } return analyticsItem; }  DateHistoAnalytics convert(HistogramAnalytics analytics); CountAnalytics convert(HitsAnalytics analytics); GroupByAnalytics convert(TopHitsAnalytics analytics);  }