![JAR search and dependency download from the Maven repository](/logo.png)
io.mstream.trader.commons.test.util.date.DateFormatter Maven / Gradle / Ivy
package io.mstream.trader.commons.test.util.date;
import io.mstream.trader.commons.test.Feature;
import io.mstream.trader.commons.test.Service;
import io.mstream.trader.commons.test.Yahoo;
import javax.inject.Inject;
import java.time.format.DateTimeFormatter;
public class DateFormatter {
private final DateTimeFormatter featureDateFormatter;
private final DateTimeFormatter serviceDateFormatter;
private final DateTimeFormatter yahooDateFormatter;
@Inject
public DateFormatter(
@Feature DateTimeFormatter featureDateFormatter,
@Service DateTimeFormatter serviceDateFormatter,
@Yahoo DateTimeFormatter yahooDateFormatter) {
this.featureDateFormatter = featureDateFormatter;
this.serviceDateFormatter = serviceDateFormatter;
this.yahooDateFormatter = yahooDateFormatter;
}
public String featureToServiceDate(String featureDate) {
return serviceDateFormatter.format(featureDateFormatter.parse(featureDate));
}
public String featureToYahooDate(String featureDate) {
return yahooDateFormatter.format(featureDateFormatter.parse(featureDate));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy