Class ValidityPeriod

  • All Implemented Interfaces:
    Serializable

    public class ValidityPeriod
    extends EqualsSupport
    implements Serializable
    Validity period used by the certification system. Since certificates only have up-to second accuracy with validity fields, this class truncates not before and not after to second accuracy.
    See Also:
    Serialized Form
    • Constructor Detail

      • ValidityPeriod

        public ValidityPeriod()
      • ValidityPeriod

        public ValidityPeriod​(org.joda.time.ReadableInstant notValidBefore,
                              org.joda.time.ReadableInstant notValidAfter)
      • ValidityPeriod

        public ValidityPeriod​(Date notValidBefore,
                              Date notValidAfter)
    • Method Detail

      • getNotValidAfter

        public org.joda.time.DateTime getNotValidAfter()
      • getNotValidBefore

        public org.joda.time.DateTime getNotValidBefore()
      • withNotValidBefore

        public ValidityPeriod withNotValidBefore​(org.joda.time.ReadableInstant notValidBefore)
      • withNotValidAfter

        public ValidityPeriod withNotValidAfter​(org.joda.time.ReadableInstant notValidAfter)
      • isExpiredNow

        public boolean isExpiredNow()
      • isExpiredAt

        public boolean isExpiredAt​(org.joda.time.ReadableInstant instant)
      • isValidNow

        public boolean isValidNow()
      • isValidAt

        public boolean isValidAt​(org.joda.time.ReadableInstant instant)
      • isClosed

        public boolean isClosed()
        Returns:
        true if this instances notValidBefore and notValidAfter are both specified.
      • intersectedWith

        public ValidityPeriod intersectedWith​(ValidityPeriod other)
        Calculates the intersection of two validity periods, taking into account open-ended validity periods.
        Parameters:
        other - the validity period to intersect with.
        Returns:
        the intersection of this and the other validity period, or null if there is no overlap.