gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-16 15:22:40 25 4
gpt4 key购买 nike

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

ZoneRules.equals介绍

[英]Checks if this set of rules equals another.

Two rule sets are equal if they will always result in the same output for any given input instant or local date-time. Rules from two different groups may return false even if they are in fact the same.

This definition should result in implementations comparing their entire state.
[中]检查这组规则是否与另一组规则相同。
如果两个规则集在任何给定的输入瞬间或本地日期时间总是产生相同的输出,则它们是相等的。来自两个不同组的规则可能会返回false,即使它们实际上是相同的。
这个定义应该导致实现比较它们的整个状态。

代码示例

代码示例来源:origin: prestodb/presto

@Override
public Atop create(AtopTable table, ZonedDateTime date)
{
  checkArgument(date.getZone().getRules().equals(timeZone.getRules()), "Split date (%s) is not in the local timezone (%s)", date.getZone(), timeZone);
  ProcessBuilder processBuilder = new ProcessBuilder(executablePath);
  processBuilder.command().add("-P");
  processBuilder.command().add(table.getAtopLabel());
  processBuilder.command().add("-r");
  processBuilder.command().add(DATE_FORMATTER.format(date));
  Process process;
  try {
    process = processBuilder.start();
  }
  catch (IOException e) {
    throw new PrestoException(ATOP_CANNOT_START_PROCESS_ERROR, format("Cannot start %s", processBuilder.command()), e);
  }
  return new AtopProcess(process, readTimeout, executor);
}

代码示例来源:origin: prestosql/presto

@Override
public Atop create(AtopTable table, ZonedDateTime date)
{
  checkArgument(date.getZone().getRules().equals(timeZone.getRules()), "Split date (%s) is not in the local timezone (%s)", date.getZone(), timeZone);
  ProcessBuilder processBuilder = new ProcessBuilder(executablePath);
  processBuilder.command().add("-P");
  processBuilder.command().add(table.getAtopLabel());
  processBuilder.command().add("-r");
  processBuilder.command().add(DATE_FORMATTER.format(date));
  Process process;
  try {
    process = processBuilder.start();
  }
  catch (IOException e) {
    throw new PrestoException(ATOP_CANNOT_START_PROCESS_ERROR, format("Cannot start %s", processBuilder.command()), e);
  }
  return new AtopProcess(process, readTimeout, executor);
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com