Temporal.getLong
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using java.time.temporal.Temporal.getLong (Showing top 9 results out of 315)

  • Common ways to obtain Temporal
private void myMethod () {
Temporal t =
  • CharSequence text;LocalDate.parse(text)
  • Smart code suggestions by Codota
}
origin: neo4j/neo4j

@Override
public final long getLong( TemporalField field )
{
  return temporal().getLong( field );
}
origin: com.github.seratch/java-time-backport

@Override
public long between(Temporal temporal1, Temporal temporal2) {
  switch(this) {
    case WEEK_BASED_YEARS:
      return Jdk8Methods.safeSubtract(temporal2.getLong(WEEK_BASED_YEAR), temporal1.getLong(WEEK_BASED_YEAR));
    case QUARTER_YEARS:
      return temporal1.until(temporal2, MONTHS) / 3;
    default:
      throw new IllegalStateException("Unreachable");
  }
}
origin: org.neo4j/neo4j-values

@Override
public final long getLong( TemporalField field )
{
  return temporal().getLong( field );
}
origin: org.jooq/jooq

private static final long millis(Temporal temporal) {
  // java.sql.* temporal types:
  if (temporal instanceof LocalDate) {
    return Date.valueOf((LocalDate) temporal).getTime();
  }
  else if (temporal instanceof LocalTime) {
    return Time.valueOf((LocalTime) temporal).getTime();
  }
  else if (temporal instanceof LocalDateTime) {
    return Timestamp.valueOf((LocalDateTime) temporal).getTime();
  }
  // OffsetDateTime
  else if (temporal.isSupported(INSTANT_SECONDS)) {
    return 1000 * temporal.getLong(INSTANT_SECONDS) + temporal.getLong(MILLI_OF_SECOND);
  }
  // OffsetTime
  else if (temporal.isSupported(MILLI_OF_DAY)) {
    return temporal.getLong(MILLI_OF_DAY);
  }
  throw fail(temporal, Long.class);
}
origin: com.github.seratch/java-time-backport

@SuppressWarnings("unchecked")
@Override
public <R extends Temporal> R adjustInto(R temporal, long newValue) {
  long curValue = getFrom(temporal);
  range().checkValidValue(newValue, this);
  return (R) temporal.with(DAY_OF_YEAR, temporal.getLong(DAY_OF_YEAR) + (newValue - curValue));
}
@Override
origin: com.github.seratch/java-time-backport

  @SuppressWarnings("unchecked")
  @Override
  public <R extends Temporal> R adjustInto(R temporal, long newValue) {
    long curValue = getFrom(temporal);
    range().checkValidValue(newValue, this);
    return (R) temporal.with(MONTH_OF_YEAR, temporal.getLong(MONTH_OF_YEAR) + (newValue - curValue) * 3);
  }
},
origin: com.github.seratch/java-time-backport

if (startInclusive.isSupported(NANO_OF_SECOND) && endExclusive.isSupported(NANO_OF_SECOND)) {
  try {
    long startNos = startInclusive.getLong(NANO_OF_SECOND);
    nanos = endExclusive.getLong(NANO_OF_SECOND) - startNos;
    if (secs > 0 && nanos < 0) {
      nanos += NANOS_PER_SECOND;
origin: com.addthis/cronus

} else {
  output = output.plus(1, ChronoUnit.HOURS);
  if (output.getLong(ChronoField.EPOCH_DAY) != input.getLong(ChronoField.EPOCH_DAY)) {
    return null;
origin: com.addthis/cronus

} else {
  output = output.minus(1, ChronoUnit.HOURS);
  if (output.getLong(ChronoField.EPOCH_DAY) != input.getLong(ChronoField.EPOCH_DAY)) {
    return null;
java.time.temporalTemporalgetLong

Popular methods of Temporal

  • plus
    Returns an object of the same type as this object with an amount added. This adjusts this temporal,
  • with
    Returns an object of the same type as this object with the specified field altered. This returns a n
  • get
  • minus
    Returns an object of the same type as this object with an amount subtracted. This adjusts this temp
  • isSupported
    Checks if the specified unit is supported. This checks if the date-time can be queried for the speci
  • query
  • range
  • until
    Calculates the period between this temporal and another temporal in terms of the specified unit. Thi

Popular in Java

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getContentResolver (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)