本文整理了Java中org.joda.time.Instant.equals()
方法的一些代码示例,展示了Instant.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instant.equals()
方法的具体详情如下:
包路径:org.joda.time.Instant
类名称:Instant
方法名:equals
暂无
代码示例来源:origin: joda-time/joda-time
return false;
} else if (!cutoverInstant.equals(other.cutoverInstant)) {
return false;
代码示例来源:origin: JodaOrg/joda-time
return false;
} else if (!cutoverInstant.equals(other.cutoverInstant)) {
return false;
代码示例来源:origin: camunda/camunda-bpm-platform
chrono = chronos.get(i);
if (minDaysInFirstWeek == chrono.getMinimumDaysInFirstWeek() &&
cutoverInstant.equals(chrono.getGregorianCutover())) {
代码示例来源:origin: joda-time/joda-time-hibernate
public boolean equals(Object x, Object y) throws HibernateException {
if (x == y) {
return true;
}
if (x == null || y == null) {
return false;
}
Instant ix = (Instant) x;
Instant iy = (Instant) y;
return ix.equals(iy);
}
代码示例来源:origin: joda-time/joda-time-hibernate
public boolean equals(Object x, Object y) throws HibernateException {
if (x == y) {
return true;
}
if (x == null || y == null) {
return false;
}
Instant ix = (Instant) x;
Instant iy = (Instant) y;
return ix.equals(iy);
}
代码示例来源:origin: JodaOrg/joda-time-hibernate
public boolean equals(Object x, Object y) throws HibernateException {
if (x == y) {
return true;
}
if (x == null || y == null) {
return false;
}
Instant ix = (Instant) x;
Instant iy = (Instant) y;
return ix.equals(iy);
}
代码示例来源:origin: JodaOrg/joda-time-hibernate
public boolean equals(Object x, Object y) throws HibernateException {
if (x == y) {
return true;
}
if (x == null || y == null) {
return false;
}
Instant ix = (Instant) x;
Instant iy = (Instant) y;
return ix.equals(iy);
}
代码示例来源:origin: com.google.caliper/caliper
@Override public boolean equals(Object obj) {
if (obj == this) {
return true;
} else if (obj instanceof Run) {
Run that = (Run) obj;
return this.id.equals(that.id)
&& this.label.equals(that.label)
&& this.startTime.equals(that.startTime);
} else {
return false;
}
}
代码示例来源:origin: net.trajano.caliper/caliper
@Override public boolean equals(Object obj) {
if (obj == this) {
return true;
} else if (obj instanceof Run) {
Run that = (Run) obj;
return this.id.equals(that.id)
&& this.label.equals(that.label)
&& this.startTime.equals(that.startTime);
} else {
return false;
}
}
代码示例来源:origin: net.shibboleth.idp/idp-cas-api
@Override
public boolean equals(final Object o) {
if (o instanceof TicketState) {
final TicketState other = (TicketState) o;
return sessId.equals(other.sessId) &&
authenticatedPrincipalName.equals(other.authenticatedPrincipalName) &&
authenticationInstant.equals(other.authenticationInstant) &&
authenticationMethod.equals(other.authenticationMethod);
}
return false;
}
代码示例来源:origin: takidau/streamingbook
public static String formatTime(Instant timestamp) {
if (timestamp == null) {
return "null";
} else if (timestamp.equals(BoundedWindow.TIMESTAMP_MIN_VALUE)) {
return "TIMESTAMP_MIN_VALUE";
} else if (timestamp.equals(BoundedWindow.TIMESTAMP_MAX_VALUE)) {
return "TIMESTAMP_MAX_VALUE";
} else if (timestamp.equals(GlobalWindow.INSTANCE.maxTimestamp())) {
return "END_OF_GLOBAL_WINDOW";
} else {
return timestamp.toString(TIME_FMT);
}
}
代码示例来源:origin: org.apache.beam/beam-runners-core-java
@Override
public boolean equals(Object object) {
if (object == this) {
return true;
}
if (!(object instanceof AlignFn)) {
return false;
}
AlignFn other = (AlignFn) object;
return other.size.equals(this.size) && other.offset.equals(this.offset);
}
代码示例来源:origin: takidau/streamingbook
private Visit findGoal(Instant timestamp, Iterable<Visit> goals) {
for (Visit goal : goals) {
if (timestamp.equals(goal.timestamp())) {
return goal;
}
}
return null;
}
代码示例来源:origin: org.apache.beam/beam-runners-direct-java
public boolean shouldFire(Instant currentWatermark) {
return currentWatermark.isAfter(fireAfter)
|| currentWatermark.equals(BoundedWindow.TIMESTAMP_MAX_VALUE);
}
代码示例来源:origin: org.apache.beam/beam-runners-direct-java
public boolean shouldFire(Instant currentWatermark) {
return currentWatermark.isAfter(fireAfter)
|| currentWatermark.equals(BoundedWindow.TIMESTAMP_MAX_VALUE);
}
代码示例来源:origin: org.apache.beam/beam-sdks-java-core
/**
* Returns a {@code WindowedValue} with the given value and timestamp, {@code GlobalWindow} and
* default pane.
*/
public static <T> WindowedValue<T> timestampedValueInGlobalWindow(T value, Instant timestamp) {
if (BoundedWindow.TIMESTAMP_MIN_VALUE.equals(timestamp)) {
return valueInGlobalWindow(value);
} else {
return new TimestampedValueInGlobalWindow<>(value, timestamp, PaneInfo.NO_FIRING);
}
}
代码示例来源:origin: org.apache.beam/beam-sdks-java-core
/**
* Formats a {@link Instant} timestamp with additional Beam-specific metadata, such as indicating
* whether the timestamp is the end of the global window or one of the distinguished values {@link
* #TIMESTAMP_MIN_VALUE} or {@link #TIMESTAMP_MIN_VALUE}.
*/
public static String formatTimestamp(Instant timestamp) {
if (timestamp.equals(TIMESTAMP_MIN_VALUE)) {
return timestamp.toString() + " (TIMESTAMP_MIN_VALUE)";
} else if (timestamp.equals(TIMESTAMP_MAX_VALUE)) {
return timestamp.toString() + " (TIMESTAMP_MAX_VALUE)";
} else if (timestamp.equals(GlobalWindow.INSTANCE.maxTimestamp())) {
return timestamp.toString() + " (end of global window)";
} else {
return timestamp.toString();
}
}
代码示例来源:origin: org.apache.beam/beam-runners-core-java
@Override
public boolean isForWindow(
String timerId, BoundedWindow window, Instant timestamp, TimeDomain timeDomain) {
boolean isEventTimer = timeDomain.equals(TimeDomain.EVENT_TIME);
Instant gcTime = LateDataUtils.garbageCollectionTime(window, windowingStrategy);
gcTime = gcTime.plus(GC_DELAY_MS);
return isEventTimer && GC_TIMER_ID.equals(timerId) && gcTime.equals(timestamp);
}
}
代码示例来源:origin: org.apache.beam/beam-sdks-java-io-kafka
@Override
public Instant getTimestampForRecord(PartitionContext context, KafkaRecord<K, V> record) {
if (record.getTimestampType().equals(KafkaTimestampType.LOG_APPEND_TIME)) {
currentWatermark = new Instant(record.getTimestamp());
} else if (currentWatermark.equals(BoundedWindow.TIMESTAMP_MIN_VALUE)) {
// This is the first record and it does not have LOG_APPEND_TIME.
// Most likely the topic is not configured correctly.
throw new IllegalStateException(
String.format(
"LogAppendTimePolicy policy is enabled in reader, but Kafka record's timestamp type "
+ "is LogAppendTime. Most likely it is not enabled on Kafka for the topic '%s'. "
+ "Actual timestamp type is '%s'.",
record.getTopic(), record.getTimestampType()));
}
return currentWatermark;
}
代码示例来源:origin: org.apache.beam/beam-sdks-java-core
/** Returns a {@code WindowedValue} with the given value, timestamp, and window. */
public static <T> WindowedValue<T> of(
T value, Instant timestamp, BoundedWindow window, PaneInfo pane) {
checkArgument(pane != null, "WindowedValue requires PaneInfo, but it was null");
boolean isGlobal = GlobalWindow.INSTANCE.equals(window);
if (isGlobal && BoundedWindow.TIMESTAMP_MIN_VALUE.equals(timestamp)) {
return valueInGlobalWindow(value, pane);
} else if (isGlobal) {
return new TimestampedValueInGlobalWindow<>(value, timestamp, pane);
} else {
return new TimestampedValueInSingleWindow<>(value, timestamp, window, pane);
}
}
内容来源于网络,如有侵权,请联系作者删除!