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

com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.RenderableDate Maven / Gradle / Ivy

There is a newer version: 3.0.1
Show newest version
package com.github.tomakehurst.wiremock.extension.responsetemplating.helpers;

import com.fasterxml.jackson.databind.util.ISO8601Utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class RenderableDate {

    private final Date date;
    private final String format;

    public RenderableDate(Date date, String format) {
        this.date = date;
        this.format = format;
    }

    @Override
    public String toString() {
        return
            format != null ?
                new SimpleDateFormat(format).format(date) :
                ISO8601Utils.format(date, false);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy