Checks if the timestamp refers to this document.
@throws java.security.NoSuchAlgorithmException on error
@return true if it checks false otherwise
@since	2.1.6
764302
public boolean verifyTimestampImprint() throws NoSuchAlgorithmException {
        if (timeStampToken == null)
            return false;
        MessageImprint imprint = timeStampToken.getTimeStampInfo().toASN1Structure().getMessageImprint();
        byte[] md = MessageDigest.getInstance("SHA-1").digest(digest);
        byte[] imphashed = imprint.getHashedMessage();
        boolean res = Arrays.equals(md, imphashed);
        return res;
    }
801076
public boolean checkTimeframeArg(String timeframe) {
        if (Pattern.compile("\\d*(d|h)", Pattern.CASE_INSENSITIVE).matcher(timeframe).matches()) {
            return true;
        } else {
            return false;
        }
    }
868517
private boolean checkDateTimeFormat(String pstrDtFmt)
    {
        boolean    blnRet = false;
        DateFormat objFmt = null;

        try
        {
            objFmt = new SimpleDateFormat(pstrDtFmt);
            blnRet = true;
        }
        catch (NullPointerException NPExIgnore)
        {
        }
        catch (IllegalArgumentException IAExIgnore)
        {
        }
        finally
        {
            if (objFmt != null) objFmt = null;
        }
        return blnRet;
    }
1243259
public boolean isMatch(ZonedDateTime date) {
        // Issue #200: Truncating the date to the least granular precision supported by different cron systems.
        // For Quartz, it's seconds while for Unix & Cron4J it's minutes.
        final boolean isSecondGranularity = cronDefinition.containsFieldDefinition(SECOND);
        if (isSecondGranularity) {
            date = date.truncatedTo(SECONDS);
        } else {
            date = date.truncatedTo(ChronoUnit.MINUTES);
        }

        final Optional<ZonedDateTime> last = lastExecution(date);
        if (last.isPresent()) {
            final Optional<ZonedDateTime> next = nextExecution(last.get());
            if (next.isPresent()) {
                return next.get().equals(date);
            } else {
                boolean everythingInRange = false;
                try {
                    everythingInRange = dateValuesInExpectedRanges(nextClosestMatch(date), date);
                } catch (final NoSuchValueException ignored) {
                    // Why is this ignored?
                }
                try {
                    everythingInRange = dateValuesInExpectedRanges(previousClosestMatch(date), date);
                } catch (final NoSuchValueException ignored) {
                    // Why is this ignored?
                }
                return everythingInRange;
            }
        }
        return false;
    }
454341
public function setExpireAtMilliSeconds(int $timestamp): bool
    {
        return $this->handle->pExpireAt($this->name, $timestamp);
    }
1075138
def has(self, key, mtime=None):
        
        v = self.__values.get(key, None)
        if not v:
            return False
        if self.check_modified_time:
            mtime = self._get_mtime(key, mtime)
            if mtime != self.__modified_times[key]:
                del self[key]
                return False
        return True
8776
private boolean isTypedTimeFullyLegal() {
        if (mIs24HourMode) {
            // For 24-hour mode, the time is legal if the hours and minutes are each legal. Note:
            // getEnteredTime() will ONLY call isTypedTimeFullyLegal() when NOT in 24hour mode.
            Boolean[] enteredZeros = {false, false, false};
            int[] values = getEnteredTime(enteredZeros);
            return (values[0] >= 0 && values[1] >= 0 && values[1] < 60 && values[2] >= 0 && values[2] < 60);
        } else {
            // For AM/PM mode, the time is legal if it contains an AM or PM, as those can only be
            // legally added at specific times based on the tree's algorithm.
            return (mTypedTimes.contains(getAmOrPmKeyCode(AM)) ||
                    mTypedTimes.contains(getAmOrPmKeyCode(PM)));
        }
    }
817391
public synchronized boolean hasNext()
    {
        try
        {
            if (!isHasCalledCheck())
            {
                setHasCalledCheck(true);
                setHasNext(getRsAndStmt().m_rs.next());
                if (!getHasNext())
                {
                    autoReleaseDbResources();
                }
            }
        }
        catch (Exception ex)
        {
            setHasNext(false);
            autoReleaseDbResources();
            if(ex instanceof ResourceClosedException)
            {
                throw (ResourceClosedException)ex;
            }
            if(ex instanceof SQLException)
            {
                throw new PersistenceBrokerSQLException("Calling ResultSet.next() failed", (SQLException) ex);
            }
            else
            {
               throw new PersistenceBrokerException("Can't get next row from ResultSet", ex);
            }
        }
        if (logger.isDebugEnabled())
            logger.debug("hasNext() -> " + getHasNext());

        return getHasNext();
    }
455051
public boolean check() throws Exception {
        Document doc = Document.loadDocument(in);
        Meta metadata = doc.getOfficeMetadata();
        if (metadata != null) {
            title = metadata.getTitle();
            subject = metadata.getSubject();
            description = metadata.getDescription();
            initialCreator = metadata.getInitialCreator();
            creator = metadata.getCreator();
            language = metadata.getLanguage();
            editingCycles = metadata.getEditingCycles();
            creationDate = metadata.getCreationDate();
            modificationDate = metadata.getDcdate();
            if (metadata.getEditingDuration() != null) {
                Duration duration = metadata.getEditingDuration().getValue();
                editingTime = duration.getTimeInMillis(Calendar.getInstance()) / 1000;
            }
            printDate = metadata.getPrintDate();
            printedBy = metadata.getPrintedBy();
            if (metadata.getKeywords() != null) {
                keywords.addAll(metadata.getKeywords());
            }
            generator = metadata.getGenerator();
            if (metadata.getDocumentStatistic() != null) {
                pages = metadata.getDocumentStatistic().getPageCount();
            }
        }

        // document specific meta
        if (doc instanceof PresentationDocument) {
            PresentationDocument presentation = (PresentationDocument) doc;
            pages = presentation.getSlideCount();
        }

        if (doc instanceof SpreadsheetDocument) {
            SpreadsheetDocument spreadsheet = (SpreadsheetDocument) doc;
            sheets = spreadsheet.getSheetCount();
        }

        return true;
    }
235723
protected Timestamp readTimestamp() throws IOException {
		int inc = _in.readInt();
		int time = _in.readInt();
		return new Timestamp(time, inc);
	}
907160
@Override
  public boolean isTimeIncluded (final long timeStamp)
  {
    if (m_aExcludeAll == true)
    {
      return false;
    }

    // Test the base calendar first. Only if the base calendar not already
    // excludes the time/date, continue evaluating this calendar instance.
    if (super.isTimeIncluded (timeStamp) == false)
    {
      return false;
    }

    final Calendar cl = createJavaCalendar (timeStamp);
    final int day = cl.get (Calendar.DAY_OF_MONTH);

    return !(isDayExcluded (day));
  }
509753
protected boolean isJanuary() {
    if (TestHackHelper.isJUnitTest()) {
      return true;
    }
    return getCalendar().get(Calendar.MONTH) == Calendar.JANUARY;
  }
137236
protected boolean hasTimeStampHeader() {
        String originTime = request.getHeader(RestMessageHeaders.X_VOLD_REQUEST_ORIGIN_TIME_MS);
        boolean result = false;
        if(originTime != null) {
            try {
                // TODO: remove the originTime field from request header,
                // because coordinator should not accept the request origin time
                // from the client.. In this commit, we only changed
                // "this.parsedRequestOriginTimeInMs" from
                // "Long.parseLong(originTime)" to current system time,
                // The reason that we did not remove the field from request
                // header right now, is because this commit is a quick fix for
                // internal performance test to be available as soon as
                // possible.

                this.parsedRequestOriginTimeInMs = System.currentTimeMillis();
                if(this.parsedRequestOriginTimeInMs < 0) {
                    RestErrorHandler.writeErrorResponse(messageEvent,
                                                        HttpResponseStatus.BAD_REQUEST,
                                                        "Origin time cannot be negative ");

                } else {
                    result = true;
                }
            } catch(NumberFormatException nfe) {
                logger.error("Exception when validating request. Incorrect origin time parameter. Cannot parse this to long: "
                                     + originTime,
                             nfe);
                RestErrorHandler.writeErrorResponse(this.messageEvent,
                                                    HttpResponseStatus.BAD_REQUEST,
                                                    "Incorrect origin time parameter. Cannot parse this to long: "
                                                            + originTime);
            }
        } else {
            logger.error("Error when validating request. Missing origin time parameter.");
            RestErrorHandler.writeErrorResponse(this.messageEvent,
                                                HttpResponseStatus.BAD_REQUEST,
                                                "Missing origin time parameter.");
        }
        return result;
    }
1327217
@Override
    public boolean isSupported(TemporalField field) {
        if (field == null) {
            return false;
        }
        return fieldValues.containsKey(field) ||
                (date != null && date.isSupported(field)) ||
                (time != null && time.isSupported(field));
    }
224775
public static function isMilliseconds($timestamp = null)
    {
        if (! $timestamp || $timestamp instanceof Carbon) {
            return false;
        }

        if (is_numeric($timestamp) && strlen((string) $timestamp) >= 12) {
            return true;
        }

        return false;
    }
986785
boolean isGMT() {

        java.util.TimeZone inner;

        if (this.id == null) {
            inner = java.util.TimeZone.getDefault();
        } else {
            inner = this.tz;
        }

        return inner.getID().equals("GMT");

    }
660244
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case TIMESTAMP:
      return isSetTimestamp();
    case VALUE:
      return isSetValue();
    case HOST:
      return isSetHost();
    }
    throw new java.lang.IllegalStateException();
  }