java.lang.Boolean.compareTo()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(10.0k)|赞(0)|评价(0)|浏览(155)

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

Boolean.compareTo介绍

[英]Compares this object to the specified boolean object to determine their relative order.
[中]将此对象与指定的布尔对象进行比较,以确定它们的相对顺序。

代码示例

代码示例来源:origin: com.h2database/h2

@Override
public int compare(Object aObj, Object bObj) {
  if (aObj instanceof Boolean && bObj instanceof Boolean) {
    Boolean a = (Boolean) aObj;
    Boolean b = (Boolean) bObj;
    return a.compareTo(b);
  }
  return super.compare(aObj, bObj);
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(getLocalAssignmentForStorm_args other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_id()).compareTo(other.is_set_id());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_id()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.id, other.id);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(sendSupervisorWorkerHeartbeat_args other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_heartbeat()).compareTo(other.is_set_heartbeat());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_heartbeat()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.heartbeat, other.heartbeat);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(LSSupervisorId other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_supervisor_id()).compareTo(other.is_set_supervisor_id());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_supervisor_id()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.supervisor_id, other.supervisor_id);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(WorkerMetricList other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_metrics()).compareTo(other.is_set_metrics());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_metrics()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.metrics, other.metrics);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(result_result other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_aze()).compareTo(other.is_set_aze());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_aze()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.aze, other.aze);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(HBNodes other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_pulseIds()).compareTo(other.is_set_pulseIds());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_pulseIds()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.pulseIds, other.pulseIds);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(TopologyHistoryInfo other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_topo_ids()).compareTo(other.is_set_topo_ids());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_topo_ids()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.topo_ids, other.topo_ids);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(GetInfoOptions other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_num_err_choice()).compareTo(other.is_set_num_err_choice());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_num_err_choice()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.num_err_choice, other.num_err_choice);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(SpoutAggregateStats other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_complete_latency_ms()).compareTo(other.is_set_complete_latency_ms());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_complete_latency_ms()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.complete_latency_ms, other.complete_latency_ms);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(failRequest_args other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_id()).compareTo(other.is_set_id());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_id()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.id, other.id);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(failRequest_result other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_aze()).compareTo(other.is_set_aze());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_aze()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.aze, other.aze);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(InvalidTopologyException other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_msg()).compareTo(other.is_set_msg());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_msg()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.msg, other.msg);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(sendSupervisorAssignments_args other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_assignments()).compareTo(other.is_set_assignments());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_assignments()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.assignments, other.assignments);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(LogConfig other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_named_logger_level()).compareTo(other.is_set_named_logger_level());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_named_logger_level()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.named_logger_level, other.named_logger_level);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(KeyAlreadyExistsException other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_msg()).compareTo(other.is_set_msg());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_msg()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.msg, other.msg);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(LSSupervisorAssignments other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_assignments()).compareTo(other.is_set_assignments());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_assignments()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.assignments, other.assignments);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(AlreadyAliveException other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_msg()).compareTo(other.is_set_msg());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_msg()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.msg, other.msg);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: apache/storm

@Override
public int compareTo(HBExecutionException other) {
 if (!getClass().equals(other.getClass())) {
  return getClass().getName().compareTo(other.getClass().getName());
 }
 int lastComparison = 0;
 lastComparison = java.lang.Boolean.valueOf(is_set_msg()).compareTo(other.is_set_msg());
 if (lastComparison != 0) {
  return lastComparison;
 }
 if (is_set_msg()) {
  lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.msg, other.msg);
  if (lastComparison != 0) {
   return lastComparison;
  }
 }
 return 0;
}

代码示例来源:origin: google/guava

public void testCompare() {
 for (boolean x : VALUES) {
  for (boolean y : VALUES) {
   // note: spec requires only that the sign is the same
   assertEquals(x + ", " + y, Boolean.valueOf(x).compareTo(y), Booleans.compare(x, y));
  }
 }
}

相关文章