com.softicar.platform.common.date.IllegalDateSpecificationException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.date;
import com.softicar.platform.common.core.exceptions.SofticarUserException;
import com.softicar.platform.common.string.Padding;
/**
* Thrown if an illegal date was specified.
*
* @author Oliver Richers
*/
public class IllegalDateSpecificationException extends SofticarUserException {
public IllegalDateSpecificationException(int year, int month, int day) {
this(
"%s-%s-%s"
.formatted(//
Padding.padLeft(year + "", '0', 2),
Padding.padLeft(month + "", '0', 2),
Padding.padLeft(day + "", '0', 2)));
}
public IllegalDateSpecificationException(String text) {
this(null, text);
}
public IllegalDateSpecificationException(Exception cause, String text) {
super(cause, CommonDateI18n.ILLEGAL_DATE_SPECIFICATION_ARG1.toDisplay(text));
}
}