本文整理了Java中java.time.Clock.equals()
方法的一些代码示例,展示了Clock.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Clock.equals()
方法的具体详情如下:
包路径:java.time.Clock
类名称:Clock
方法名:equals
[英]Checks if this clock is equal to another clock.
Clocks must compare equal based on their state and behavior.
[中]检查此时钟是否等于另一个时钟。
时钟必须根据其状态和行为进行比较。
代码示例来源:origin: EvoSuite/evosuite
@Override
public boolean equals(Object obj) {
if (obj instanceof MockClock.MockTickClock) {
MockClock.MockTickClock other = (MockClock.MockTickClock) obj;
return baseClock.equals(other.baseClock) && tickNanos == other.tickNanos;
}
return false;
}
@Override
代码示例来源:origin: com.github.seratch/java-time-backport
@Override
public boolean equals(Object obj) {
if (obj instanceof TickClock) {
TickClock other = (TickClock) obj;
return baseClock.equals(other.baseClock) && tickNanos == other.tickNanos;
}
return false;
}
@Override
代码示例来源:origin: EvoSuite/evosuite
@Override
public boolean equals(Object obj) {
return super.equals(obj);
}
代码示例来源:origin: com.bazaarvoice.emodb/emodb-common-dropwizard
public static Ticker getTicker(Clock clock) {
// Return the singleton instance for the default UTC clock
if (Clock.systemUTC().equals(clock)) {
return DEFAULT;
}
return new ClockTickerImpl(clock);
}
代码示例来源:origin: com.github.seratch/java-time-backport
@Override
public boolean equals(Object obj) {
if (obj instanceof OffsetClock) {
OffsetClock other = (OffsetClock) obj;
return baseClock.equals(other.baseClock) && offset.equals(other.offset);
}
return false;
}
@Override
代码示例来源:origin: bazaarvoice/emodb
public static Ticker getTicker(Clock clock) {
// Return the singleton instance for the default UTC clock
if (Clock.systemUTC().equals(clock)) {
return DEFAULT;
}
return new ClockTickerImpl(clock);
}
代码示例来源:origin: io.projectreactor.addons/reactor-extra
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
SchedulerClock that = (SchedulerClock) o;
return scheduler.equals(that.scheduler) && zone.equals(that.zone);
}
内容来源于网络,如有侵权,请联系作者删除!