/** * Fetch all the values. Added for backwards compatibility with 5.x when date fields were {@link Longs}. */ @Deprecated public List<JodaCompatibleZonedDateTime> getDates() { deprecated("scripting_get_date_deprecation", "getDates is no longer necessary on date fields as the values are now dates."); return this; }
/** * Fetch the first value. Added for backwards compatibility with 5.x when date fields were {@link Longs}. */ @Deprecated public JodaCompatibleZonedDateTime getDate() { deprecated("scripting_get_date_deprecation", "getDate is no longer necessary on date fields as the value is now a date."); return getValue(); }
/** * Fetch the first field value or 0 millis after epoch if there are no * in. */ public JodaCompatibleZonedDateTime getValue() { if (count == 0) { if (ScriptDocValues.EXCEPTION_FOR_MISSING_VALUE) { throw new IllegalStateException("A document doesn't have a value for a field! " + "Use doc[<field>].size()==0 to check if a document is missing a field!"); } deprecated("scripting_missing_value_deprecation", "returning default values for missing document values is deprecated. " + "Set system property '-Des.scripting.exception_for_missing_value=true' " + "to make behaviour compatible with future major versions!"); return EPOCH; } return get(0); }
/** * Fetch the first field value or 0 millis after epoch if there are no * in. */ public JodaCompatibleZonedDateTime getValue() { if (count == 0) { if (ScriptDocValues.EXCEPTION_FOR_MISSING_VALUE) { throw new IllegalStateException("A document doesn't have a value for a field! " + "Use doc[<field>].size()==0 to check if a document is missing a field!"); } deprecated("scripting_missing_value_deprecation", "returning default values for missing document values is deprecated. " + "Set system property '-Des.scripting.exception_for_missing_value=true' " + "to make behaviour compatible with future major versions!"); return EPOCH; } return get(0); }
/** * Fetch the first value. Added for backwards compatibility with 5.x when date fields were {@link Longs}. */ @Deprecated public ReadableDateTime getDate() { deprecated("getDate is no longer necessary on date fields as the value is now a date."); return getValue(); }
/** * Fetch all the values. Added for backwards compatibility with 5.x when date fields were {@link Longs}. */ @Deprecated public List<JodaCompatibleZonedDateTime> getDates() { deprecated("scripting_get_date_deprecation", "getDates is no longer necessary on date fields as the values are now dates."); return this; }
/** * Fetch the first value. Added for backwards compatibility with 5.x when date fields were {@link Longs}. */ @Deprecated public JodaCompatibleZonedDateTime getDate() { deprecated("scripting_get_date_deprecation", "getDate is no longer necessary on date fields as the value is now a date."); return getValue(); }
/** * Fetch all the values. Added for backwards compatibility with 5.x when date fields were {@link Longs}. */ @Deprecated public List<ReadableDateTime> getDates() { deprecated("getDates is no longer necessary on date fields as the values are now dates."); return this; }