@ServiceProvider public class TimeFieldReplacerFactory extends Object implements FieldReplacer.Factory
FieldReplacer that provides an ability to replace
time and milisseconds time fields
according to the specified strategy.
field replacer should be in the following format:
"time:<recordFilter>:<configuration>", where recordFilter is a RecordOnlyFilter
and configuration is a configuration of replacing strategy.
For all record cursors which are accepted by recordFilter
all fields with the serial type TIME_SECONDS or
TIME_MILLIS (or created from them by SerialFieldType.withName(String)
method) are replaced with the new time according to the specified strategy.
System.currentTimeMillis().
Configuration format: "current";"+<time>" or "-<time>";"<time>".All times should be in format according to TimePeriod.valueOf(String),
but with no more than seconds precision.
example.qds and changes the time
of two hours and three minutes ago in all records.
DXEndpoint endpoint = ...
endpoint.connect("example.qds[fieldReplacer=time:*:-2h3m");
FieldReplacer| Constructor and Description |
|---|
TimeFieldReplacerFactory() |
| Modifier and Type | Method and Description |
|---|---|
FieldReplacer |
createFieldReplacer(String fieldReplacerSpec,
DataScheme dataScheme)
Creates
field replacer for specified data scheme
from specification. |
public FieldReplacer createFieldReplacer(String fieldReplacerSpec, DataScheme dataScheme)
FieldReplacer.Factoryfield replacer for specified data scheme
from specification.
NOTE: the only one factory can support specification.
createFieldReplacer in interface FieldReplacer.FactoryfieldReplacerSpec - specification of FieldReplacer. The specification should start with
"<factory_name>:" to detect should factory support the specification or not.dataScheme - current data schemefield replacer if this factory supports specification,
null otherwise.Copyright © 2002–2025 Devexperts LLC. All rights reserved.