我想知道是否有办法隐藏已识别元素的父元素.
例如:
<div>
<span id="abx">some garbage content</span>
<div>other garbage containers not having any class or id</div>
</div>
Run Code Online (Sandbox Code Playgroud)
要选择的AdBlockPlus的自定义过滤器abx将是:
##span#abx
Run Code Online (Sandbox Code Playgroud)
但是如何选择其父元素呢?因为我们需要隐藏已识别元素的所有兄弟姐妹.
我有JPA实体扩展其他抽象类.我想使用@Data来避免编写setter和getter,但我的equals和hashcode方法存在.
我收到警告,但我想我不应该:
server\entity\User.java:20: warning: Generating equals/hashCode implementation but without a call to superclass, even though this class does not extend java.lang.Object. If this is intentional, add '@EqualsAndHashCode(callSuper=false)' to your type.
@Data
^
Run Code Online (Sandbox Code Playgroud)
在我的User类中:
@Data
@Entity
public class User extends AbstractAuditingEntity implements Serializable {
....
@Override
public boolean equals(Object o) {
...
}
@Override
public int hashCode() {
...
}
}
Run Code Online (Sandbox Code Playgroud)
当我另外将@EqualsAndHashCode(callSuper = false)添加到@Data时,我得到:
server\entity\User.java:21: warning: Not generating equals and hashCode: A method with one of those names already exists. (Either …Run Code Online (Sandbox Code Playgroud) 我使用JustMock框架并具有以下断言:
Mock.Assert(() => activityListenerMock.PeriodPassed(
Arg.Matches<Period>(e => e.Length == expectedLength)));
Run Code Online (Sandbox Code Playgroud)
它失败了,含有神秘的信息:
Occurrence expectation failed. Expected at least 1 call. Calls so far: 0
Run Code Online (Sandbox Code Playgroud)
我怎样才能得到更好的信息.我想知道它被称为什么价值.
方法实际上被调用但是有错误的参数,因为当我将断言更改为跟随它传递时:
Mock.Assert(() => activityListenerMock.PeriodPassed(
Arg.IsAny<Period>()));
Run Code Online (Sandbox Code Playgroud)