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

org.brutusin.demo.spring.GetDateAction Maven / Gradle / Ivy

There is a newer version: 1.9.2
Show newest version
package org.brutusin.demo.spring;

import java.text.SimpleDateFormat;
import java.util.Date;
import org.brutusin.rpc.http.Cacheable;
import org.brutusin.rpc.http.SafeAction;

public class GetDateAction extends SafeAction {

    private SimpleDateFormat dateFormat = new SimpleDateFormat();

    @Override
    public Cacheable execute(Void input) throws Exception {
        return Cacheable.never(dateFormat.format(new Date()));
    }

    public void setDatePattern(String pattern) {
        dateFormat = new SimpleDateFormat(pattern);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy