public final class QuoteExpirationTimeUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_OFFER_VALIDITY_PERIOD_IN_DAYS |
static int |
MIN_OFFER_VALIDITY_PERIOD_IN_DAYS |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Date |
determineExpirationTime(java.util.Date oldExpiryDate,
java.util.Date today)
Determines the expiration time for a quote by checking if the expiration time that is currently set for the quote
is valid or not using
isExpirationTimeValid(Date, Date) method. |
static int |
getDefaultOfferValidityPeriodDays()
Gets the configured value for the quote default offer validity period in days or 30 if the property is not found.
|
static java.util.Date |
getEndOfDay(java.util.Date day)
Sets the time part of the provided input date parameter to end of day (23:59:59).
|
static int |
getMinOfferValidityPeriodInDays()
Gets the configured value for the quote minimum offer validity period in days or 1 if the property is not found.
|
static boolean |
isExpirationTimeValid(java.util.Date expiryDate,
java.util.Date today)
Checks if the expiration date provided as input is valid or not.
|
public static final int DEFAULT_OFFER_VALIDITY_PERIOD_IN_DAYS
public static final int MIN_OFFER_VALIDITY_PERIOD_IN_DAYS
public static int getDefaultOfferValidityPeriodDays()
public static int getMinOfferValidityPeriodInDays()
public static java.util.Date determineExpirationTime(java.util.Date oldExpiryDate,
java.util.Date today)
isExpirationTimeValid(Date, Date) method. If it is valid, it returns the expiration
time as is, otherwise it returns an expiration time set to current date with normalized time plus the quote
default offer validity period in days and with the time part set to end day.oldExpiryDate - the expiration date that is currently set for the quotetoday - the current date with normalized timepublic static java.util.Date getEndOfDay(java.util.Date day)
day - the date for which the time part to be set to end of daypublic static boolean isExpirationTimeValid(java.util.Date expiryDate,
java.util.Date today)
expiryDate - the expiration date to checktoday - the current date with normalized timeCopyright © 2018 SAP SE. All Rights Reserved.