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

fi.evolver.basics.spring.util.RangeT Maven / Gradle / Ivy

There is a newer version: 6.7.0
Show newest version
package fi.evolver.basics.spring.util;

import java.time.LocalDateTime;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;

public class RangeT {
	private LocalDateTime min;
	private LocalDateTime max;


	public LocalDateTime getMin() {
		return min;
	}

	@DateTimeFormat(iso = ISO.DATE_TIME, fallbackPatterns = { "yyyy-MM-dd H:m[:ss[.SSS]]", "yyyy-MM-dd H:m:ss.SS", "yyyy-MM-dd H:m:ss.S", "d.M.yyyy H:m[:ss[.SSS]", "d.M.yyyy H:m:ss.SS", "d.M.yyyy H:m:ss.S" })
	public void setMin(LocalDateTime min) {
		this.min = min;
	}


	public LocalDateTime getMax() {
		return max;
	}

	@DateTimeFormat(iso = ISO.DATE_TIME, fallbackPatterns = { "yyyy-MM-dd H:m[:ss[.SSS]]", "yyyy-MM-dd H:m:ss.SS", "yyyy-MM-dd H:m:ss.S", "d.M.yyyy H:m[:ss[.SSS]", "d.M.yyyy H:m:ss.SS", "d.M.yyyy H:m:ss.S" })
	public void setMax(LocalDateTime max) {
		this.max = max;
	}


	@Override
	public String toString() {
		return String.format("%s-%s", min != null ? min : "", max != null ? max : "");
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy