Class DateIntervalWrapper

java.lang.Object
org.elasticsearch.search.aggregations.bucket.histogram.DateIntervalWrapper
All Implemented Interfaces:
Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public class DateIntervalWrapper extends Object implements org.elasticsearch.common.xcontent.ToXContentFragment, Writeable
A class that handles all the parsing, bwc and deprecations surrounding date histogram intervals. - Provides parser helpers for the deprecated interval/dateHistogramInterval parameters. - Provides parser helpers for the new calendar/fixed interval parameters - Can read old intervals from a stream and convert to new intervals - Can write new intervals to old format when streaming out - Provides a variety of helper methods to interpret the intervals as different types, depending on caller's need After the deprecated parameters are removed, this class can be simplified greatly. The legacy options will be removed, and the mutual-exclusion checks can be done in the setters directly removing the need for the enum and the complicated "state machine" logic