本文整理了Java中com.eaio.uuid.UUID.compareTo()
方法的一些代码示例,展示了UUID.compareTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UUID.compareTo()
方法的具体详情如下:
包路径:com.eaio.uuid.UUID
类名称:UUID
方法名:compareTo
[英]Compares this UUID to another Object. Throws a ClassCastException if the other Object is not an instance of the UUID class. Returns a value smaller than zero if the other UUID is "larger" than this UUID and a value larger than zero if the other UUID is "smaller" than this UUID.
[中]将此UUID与另一个对象进行比较。如果另一个对象不是UUID类的实例,则引发ClassCastException。如果另一个UUID比此UUID“大”,则返回小于零的值;如果另一个UUID比此UUID“小”,则返回大于零的值。
代码示例来源:origin: stephenc/eaio-uuid
/**
* Compares two Objects for equality.
*
* @see java.lang.Object#equals(Object)
* @param obj the Object to compare this UUID with, may be <code>null</code>
* @return <code>true</code> if the other Object is equal to this UUID,
* <code>false</code> if not
*/
@Override
public boolean equals(Object obj) {
if (!(obj instanceof UUID)) {
return false;
}
return compareTo((UUID) obj) == 0;
}
代码示例来源:origin: se.scalablesolutions.akka/akka-actor
/**
* Compares two Objects for equality.
*
* @see java.lang.Object#equals(Object)
* @param obj the Object to compare this UUID with, may be <code>null</code>
* @return <code>true</code> if the other Object is equal to this UUID,
* <code>false</code> if not
*/
@Override
public boolean equals(Object obj) {
if (!(obj instanceof UUID)) {
return false;
}
return compareTo((UUID) obj) == 0;
}
内容来源于网络,如有侵权,请联系作者删除!