public class Validity
extends java.lang.Object
| Constructor and Description |
|---|
Validity(java.util.Calendar a_validFrom,
java.util.Calendar a_validTo)
Creates a new Validity.
|
Validity(java.util.Calendar a_validFrom,
int a_validityInYears)
Creates a new Validity.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Date |
getValidFrom()
Returns the first valid date in the validity period.
|
java.util.Date |
getValidTo()
Returns the last valid date in the validity period.
|
boolean |
isValid(java.util.Date a_date)
Checks if the given date is contained in the validity period.
|
public Validity(java.util.Calendar a_validFrom,
int a_validityInYears)
a_validFrom - a Calendar object that represents a start datea_validityInYears - an amount of years that the created date should lie ahead from the
start date; if the amount is less than 0 the created date will
only be ahead from the start date for a very small time
(some minutes)java.lang.IllegalArgumentException - if the calendar is nullpublic Validity(java.util.Calendar a_validFrom,
java.util.Calendar a_validTo)
a_validFrom - a Calendar object that represents a start datea_validTo - a Calendar object that represents a end date; if the date lies before
the start date it will be set equal to the start datejava.lang.IllegalArgumentException - if on of the calendars is nullpublic java.util.Date getValidFrom()
public java.util.Date getValidTo()
public boolean isValid(java.util.Date a_date)
a_date - a DateCopyright © 2023. All rights reserved.