org.joda.time.Instant.withMillis()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(153)

本文整理了Java中org.joda.time.Instant.withMillis()方法的一些代码示例,展示了Instant.withMillis()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instant.withMillis()方法的具体详情如下:
包路径:org.joda.time.Instant
类名称:Instant
方法名:withMillis

Instant.withMillis介绍

[英]Gets a copy of this instant with different millis.

The returned object will be either be a new Instant or this.
[中]获取具有不同毫秒数的此即时消息的副本。
返回的对象将是新的即时对象或this

代码示例

代码示例来源:origin: joda-time/joda-time

/**
 * Gets a copy of this instant with the specified duration added.
 * <p>
 * If the addition is zero, then <code>this</code> is returned.
 * 
 * @param durationToAdd  the duration to add to this one
 * @param scalar  the amount of times to add, such as -1 to subtract once
 * @return a copy of this instant with the duration added
 * @throws ArithmeticException if the new instant exceeds the capacity of a long
 */
public Instant withDurationAdded(long durationToAdd, int scalar) {
  if (durationToAdd == 0 || scalar == 0) {
    return this;
  }
  long instant = getChronology().add(getMillis(), durationToAdd, scalar);
  return withMillis(instant);
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Gets a copy of this instant with the specified duration added.
 * <p>
 * If the addition is zero, then <code>this</code> is returned.
 * 
 * @param durationToAdd  the duration to add to this one
 * @param scalar  the amount of times to add, such as -1 to subtract once
 * @return a copy of this instant with the duration added
 * @throws ArithmeticException if the new instant exceeds the capacity of a long
 */
public Instant withDurationAdded(long durationToAdd, int scalar) {
  if (durationToAdd == 0 || scalar == 0) {
    return this;
  }
  long instant = getChronology().add(getMillis(), durationToAdd, scalar);
  return withMillis(instant);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Gets a copy of this instant with the specified duration added.
 * <p>
 * If the addition is zero, then <code>this</code> is returned.
 * 
 * @param durationToAdd  the duration to add to this one
 * @param scalar  the amount of times to add, such as -1 to subtract once
 * @return a copy of this instant with the duration added
 * @throws ArithmeticException if the new instant exceeds the capacity of a long
 */
public Instant withDurationAdded(long durationToAdd, int scalar) {
  if (durationToAdd == 0 || scalar == 0) {
    return this;
  }
  long instant = getChronology().add(getMillis(), durationToAdd, scalar);
  return withMillis(instant);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Gets a copy of this instant with the specified duration added.
 * <p>
 * If the addition is zero, then <code>this</code> is returned.
 * 
 * @param durationToAdd  the duration to add to this one
 * @param scalar  the amount of times to add, such as -1 to subtract once
 * @return a copy of this instant with the duration added
 * @throws ArithmeticException if the new instant exceeds the capacity of a long
 */
public Instant withDurationAdded(long durationToAdd, int scalar) {
  if (durationToAdd == 0 || scalar == 0) {
    return this;
  }
  long instant = getChronology().add(getMillis(), durationToAdd, scalar);
  return withMillis(instant);
}

代码示例来源:origin: org.joda/com.springsource.org.joda.time

/**
 * Gets a copy of this instant with the specified duration added.
 * <p>
 * If the addition is zero, then <code>this</code> is returned.
 * 
 * @param durationToAdd  the duration to add to this one
 * @param scalar  the amount of times to add, such as -1 to subtract once
 * @return a copy of this instant with the duration added
 * @throws ArithmeticException if the new instant exceeds the capacity of a long
 */
public Instant withDurationAdded(long durationToAdd, int scalar) {
  if (durationToAdd == 0 || scalar == 0) {
    return this;
  }
  long instant = getChronology().add(getMillis(), durationToAdd, scalar);
  return withMillis(instant);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time

/**
 * Gets a copy of this instant with the specified duration added.
 * <p>
 * If the addition is zero, then <code>this</code> is returned.
 * 
 * @param durationToAdd  the duration to add to this one
 * @param scalar  the amount of times to add, such as -1 to subtract once
 * @return a copy of this instant with the duration added
 * @throws ArithmeticException if the new instant exceeds the capacity of a long
 */
public Instant withDurationAdded(long durationToAdd, int scalar) {
  if (durationToAdd == 0 || scalar == 0) {
    return this;
  }
  long instant = getChronology().add(getMillis(), durationToAdd, scalar);
  return withMillis(instant);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Gets a copy of this instant with the specified duration added.
 * <p>
 * If the addition is zero, then <code>this</code> is returned.
 * 
 * @param durationToAdd  the duration to add to this one
 * @param scalar  the amount of times to add, such as -1 to subtract once
 * @return a copy of this instant with the duration added
 * @throws ArithmeticException if the new instant exceeds the capacity of a long
 */
public Instant withDurationAdded(long durationToAdd, int scalar) {
  if (durationToAdd == 0 || scalar == 0) {
    return this;
  }
  long instant = getChronology().add(getMillis(), durationToAdd, scalar);
  return withMillis(instant);
}

代码示例来源:origin: Nextdoor/bender

/**
 * Gets a copy of this instant with the specified duration added.
 * <p>
 * If the addition is zero, then <code>this</code> is returned.
 * 
 * @param durationToAdd  the duration to add to this one
 * @param scalar  the amount of times to add, such as -1 to subtract once
 * @return a copy of this instant with the duration added
 * @throws ArithmeticException if the new instant exceeds the capacity of a long
 */
public Instant withDurationAdded(long durationToAdd, int scalar) {
  if (durationToAdd == 0 || scalar == 0) {
    return this;
  }
  long instant = getChronology().add(getMillis(), durationToAdd, scalar);
  return withMillis(instant);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Gets a copy of this instant with the specified duration added.
 * <p>
 * If the addition is zero, then <code>this</code> is returned.
 * 
 * @param durationToAdd  the duration to add to this one
 * @param scalar  the amount of times to add, such as -1 to subtract once
 * @return a copy of this instant with the duration added
 * @throws ArithmeticException if the new instant exceeds the capacity of a long
 */
public Instant withDurationAdded(long durationToAdd, int scalar) {
  if (durationToAdd == 0 || scalar == 0) {
    return this;
  }
  long instant = getChronology().add(getMillis(), durationToAdd, scalar);
  return withMillis(instant);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Gets a copy of this instant with the specified duration added.
 * <p>
 * If the addition is zero, then <code>this</code> is returned.
 * 
 * @param durationToAdd  the duration to add to this one
 * @param scalar  the amount of times to add, such as -1 to subtract once
 * @return a copy of this instant with the duration added
 * @throws ArithmeticException if the new instant exceeds the capacity of a long
 */
public Instant withDurationAdded(long durationToAdd, int scalar) {
  if (durationToAdd == 0 || scalar == 0) {
    return this;
  }
  long instant = getChronology().add(getMillis(), durationToAdd, scalar);
  return withMillis(instant);
}

代码示例来源:origin: redfish64/TinyTravelTracker

/**
 * Gets a copy of this instant with the specified duration added.
 * <p>
 * If the addition is zero, then <code>this</code> is returned.
 * 
 * @param durationToAdd  the duration to add to this one
 * @param scalar  the amount of times to add, such as -1 to subtract once
 * @return a copy of this instant with the duration added
 * @throws ArithmeticException if the new instant exceeds the capacity of a long
 */
public Instant withDurationAdded(long durationToAdd, int scalar) {
  if (durationToAdd == 0 || scalar == 0) {
    return this;
  }
  long instant = getChronology().add(getMillis(), durationToAdd, scalar);
  return withMillis(instant);
}

代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform

case DATETIME:
 ret = new Instant().withMillis(((long) value) / 1000);
 break;
case STRING:

相关文章