java.time.Clock.equals()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(212)

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

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);
}

相关文章