private static LocalDate getLocalDateFromEpochTime(String fieldName, Object coercedValue) { Long date = DataTypeUtils.toLong(coercedValue, fieldName); return Instant.ofEpochMilli(date).atZone(ZoneId.systemDefault()).toLocalDate(); }
private static LocalDateTime getLocalDateTimeFromEpochTime(String fieldName, Object coercedValue) { Long date = DataTypeUtils.toLong(coercedValue, fieldName); return Instant.ofEpochMilli(date).atZone(ZoneId.systemDefault()).toLocalDateTime(); }
@Override public Long getAsLong(final String fieldName) { return DataTypeUtils.toLong(getValue(fieldName), fieldName); }
final String stringValue = DataTypeUtils.toString(coercedValue, () -> DataTypeUtils.getDateFormat(this.dateFormat)); if (DataTypeUtils.isLongTypeCompatible(stringValue)) { generator.writeNumber(DataTypeUtils.toLong(coercedValue, fieldName)); } else { generator.writeString(stringValue); final String stringValue = DataTypeUtils.toString(coercedValue, () -> DataTypeUtils.getDateFormat(this.timeFormat)); if (DataTypeUtils.isLongTypeCompatible(stringValue)) { generator.writeNumber(DataTypeUtils.toLong(coercedValue, fieldName)); } else { generator.writeString(stringValue); final String stringValue = DataTypeUtils.toString(coercedValue, () -> DataTypeUtils.getDateFormat(this.timestampFormat)); if (DataTypeUtils.isLongTypeCompatible(stringValue)) { generator.writeNumber(DataTypeUtils.toLong(coercedValue, fieldName)); } else { generator.writeString(stringValue); break; case LONG: generator.writeNumber(DataTypeUtils.toLong(coercedValue, fieldName)); break; case INT:
break; case LONG: addFieldToSolrDocument(inputDocument,fieldName,DataTypeUtils.toLong(coercedValue, fieldName),fieldsToIndex); break; case INT:
final String stringValue = DataTypeUtils.toString(coercedValue, LAZY_DATE_FORMAT); if (DataTypeUtils.isLongTypeCompatible(stringValue)) { generator.writeNumber(DataTypeUtils.toLong(coercedValue, fieldName)); } else { generator.writeString(stringValue); final String stringValue = DataTypeUtils.toString(coercedValue, LAZY_TIME_FORMAT); if (DataTypeUtils.isLongTypeCompatible(stringValue)) { generator.writeNumber(DataTypeUtils.toLong(coercedValue, fieldName)); } else { generator.writeString(stringValue); final String stringValue = DataTypeUtils.toString(coercedValue, LAZY_TIMESTAMP_FORMAT); if (DataTypeUtils.isLongTypeCompatible(stringValue)) { generator.writeNumber(DataTypeUtils.toLong(coercedValue, fieldName)); } else { generator.writeString(stringValue); break; case LONG: generator.writeNumber(DataTypeUtils.toLong(coercedValue, fieldName)); break; case INT:
return toInteger(value, fieldName); case LONG: return toLong(value, fieldName); case SHORT: return toShort(value, fieldName);
private static LocalDate getLocalDateFromEpochTime(String fieldName, Object coercedValue) { Long date = DataTypeUtils.toLong(coercedValue, fieldName); return Instant.ofEpochMilli(date).atZone(ZoneId.systemDefault()).toLocalDate(); }
private static LocalDateTime getLocalDateTimeFromEpochTime(String fieldName, Object coercedValue) { Long date = DataTypeUtils.toLong(coercedValue, fieldName); return Instant.ofEpochMilli(date).atZone(ZoneId.systemDefault()).toLocalDateTime(); }
@Override public Long getAsLong(final String fieldName) { return DataTypeUtils.toLong(getValue(fieldName), fieldName); }
break; case LONG: addFieldToSolrDocument(inputDocument,fieldName,DataTypeUtils.toLong(coercedValue, fieldName),fieldsToIndex); break; case INT:
return toInteger(value, fieldName); case LONG: return toLong(value, fieldName); case SHORT: return toShort(value, fieldName);