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

com.softicar.platform.common.date.IllegalDateSpecificationException Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
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));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy