@Override public T apply(T current, T transformed) { for (Map.Entry<String, String> mapping : keyMappings.entrySet()) { if (current.getPropertyValue(mapping.getKey()) != null) { current.setProperty(mapping.getValue(), current.getPropertyValue(mapping.getKey())); current.removeProperty(mapping.getKey()); } } return current; } }
@Override public T apply(T current, T transformed) { for (Map.Entry<String, String> mapping : keyMappings.entrySet()) { if (current.getPropertyValue(mapping.getKey()) != null) { current.setProperty(mapping.getValue(), current.getPropertyValue(mapping.getKey())); current.removeProperty(mapping.getKey()); } } return current; } }
@Override public E apply(E current, E transformed) { PropertyValue timePropertyValue = current.getPropertyValue(propertyKey); if (timePropertyValue == null) { return current; } LocalDateTime timeOfCall = LocalDateTime.ofEpochSecond( (long) timePropertyValue.getInt(), 0, OffsetDateTime.now().getOffset()); transformed.setLabel(current.getLabel()); transformed.setProperty("year", timeOfCall.getYear()); transformed.setProperty("month", timeOfCall.getMonth().getValue()); transformed.setProperty("day", timeOfCall.getDayOfMonth()); transformed.setProperty("hour", timeOfCall.getHour()); transformed.setProperty("minute", timeOfCall.getMinute()); return transformed; } }
if (keepHistory) { transformed.setProperty( propertyKey + PROPERTY_VERSION_SEPARATOR + getNextVersionNumber(current), current.getPropertyValue(propertyKey)); transformed.setProperty( propertyKey, transformationFunction.execute(current.getPropertyValue(propertyKey))); transformed.setProperty( newPropertyKey, transformationFunction.execute(current.getPropertyValue(propertyKey)));