All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.mstream.trader.commons.test.util.date.DateFormatter Maven / Gradle / Ivy

The newest version!
package io.mstream.trader.commons.test.util.date;

import java.time.format.DateTimeFormatter;
import java.util.function.Function;


public class DateFormatter implements Function {

    private final DateTimeFormatter source;
    private final DateTimeFormatter target;


    public DateFormatter(
            DateTimeFormatter source,
            DateTimeFormatter target
    ) {
        this.source = source;
        this.target = target;
    }

    @Override
    public String apply(String dateText) {
        return target.format(source.parse(dateText));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy