提交 d2e8ff3b 编写于 作者: 梦境迷离's avatar 梦境迷离

change readme

上级 59192077
......@@ -222,8 +222,8 @@ def <init>(int: Int, j: Int, k: Option[String], t: Option[Long], b: Int) = {
- 说明
- `verbose` 指定是否开启详细编译日志。可选,默认`false`
- `excludeFields` 指定是否需要排除不需要用于`equals``hashCode`方法的字段。可选,默认空(class内部所有非私有的`var、val`字段都将被应用于生成这两个方法)。
- `equals``hashCode`方法均会被超类的影响,`canEqual`使用`isInstanceOf`
- 采用简单hashCode算法,父类的hashCode是直接被累加的。
- `equals``hashCode`方法均会被超类影响,`canEqual`使用`isInstanceOf`,有些人在实现时,使用的是`this.getClass == that.getClass`
- 采用简单hashCode算法,父类的hashCode是直接被累加的。该算法是`case class`使用的。
- 示例
......
......@@ -229,7 +229,7 @@ The `@equalsAndHashCode` annotation is used to generate `equals` and `hashCode`
default is `Nil` (all non private `var` and `val` fields in the class will be used to generate the two methods).
- Both `equals` and `hashCode` methods are affected by super classes, and `canEqual` uses `isInstanceOf` in `equals` method.
Some equals implementations use `that.getClass == this.getClass`
- It uses simple hashcode algorithm, and the hashcodes of the parent class are accumulated directly.
- It uses simple hashcode algorithm, and the hashcodes of the parent class are accumulated directly. The algorithm is also used by `case class`.
- Example
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册