@Override public DateTime get(int index) { JodaCompatibleZonedDateTime dt = realDV.get(index); return new DateTime(dt.toInstant().toEpochMilli(), DateTimeZone.UTC); }
/** * 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); }
@Override public DateTime get(int index) { JodaCompatibleZonedDateTime dt = realDV.get(index); return new DateTime(dt.toInstant().toEpochMilli(), DateTimeZone.UTC); }
/** * 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 ReadableDateTime getValue() { if (count == 0) { if (ScriptModule.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!"); } return EPOCH; } return get(0); }
/** * Fetch the first field value or 0 millis after epoch if there are no values. */ public ReadableDateTime getValue() { if (values.count() == 0) { return EPOCH; } return get(0); }