本文整理汇总了Java中com.google.ipc.invalidation.common.ObjectIdDigestUtils类的典型用法代码示例。如果您正苦于以下问题:Java ObjectIdDigestUtils类的具体用法?Java ObjectIdDigestUtils怎么用?Java ObjectIdDigestUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectIdDigestUtils类属于com.google.ipc.invalidation.common包,在下文中一共展示了ObjectIdDigestUtils类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: add
import com.google.ipc.invalidation.common.ObjectIdDigestUtils; //导入依赖的package包/类
@Override
public Collection<ObjectIdP> add(Collection<ObjectIdP> oids) {
Collection<ObjectIdP> addedOids = new ArrayList<ObjectIdP>();
for (ObjectIdP oid : oids) {
if (registrations.put(ObjectIdDigestUtils.getDigest(oid.getSource(),
oid.getName().getByteArray(), digestFunction), oid) == null) {
// There was no previous value, so this is a new item.
addedOids.add(oid);
}
}
if (!addedOids.isEmpty()) {
// Only recompute the digest if we made changes.
recomputeDigest();
}
return addedOids;
}
示例2: remove
import com.google.ipc.invalidation.common.ObjectIdDigestUtils; //导入依赖的package包/类
@Override
public boolean remove(ObjectIdP oid) {
if (registrations.remove(ObjectIdDigestUtils.getDigest(oid.getSource(),
oid.getName().getByteArray(), digestFunction)) != null) {
recomputeDigest();
return true;
}
return false;
}
示例3: getRegistrationManagerStateCopyForTest
import com.google.ipc.invalidation.common.ObjectIdDigestUtils; //导入依赖的package包/类
@Override
public RegistrationManagerState getRegistrationManagerStateCopyForTest() {
Preconditions.checkState(resources.getInternalScheduler().isRunningOnThread());
return registrationManager.getRegistrationManagerStateCopyForTest(
new ObjectIdDigestUtils.Sha1DigestFunction());
}
示例4: add
import com.google.ipc.invalidation.common.ObjectIdDigestUtils; //导入依赖的package包/类
@Override
public boolean add(ObjectIdP oid) {
if (registrations.put(ObjectIdDigestUtils.getDigest(oid, digestFunction), oid) == null) {
recomputeDigest();
return true;
}
return false;
}
示例5: remove
import com.google.ipc.invalidation.common.ObjectIdDigestUtils; //导入依赖的package包/类
@Override
public boolean remove(ObjectIdP oid) {
if (registrations.remove(ObjectIdDigestUtils.getDigest(oid, digestFunction)) != null) {
recomputeDigest();
return true;
}
return false;
}
示例6: contains
import com.google.ipc.invalidation.common.ObjectIdDigestUtils; //导入依赖的package包/类
@Override
public boolean contains(ObjectIdP oid) {
return registrations.containsKey(ObjectIdDigestUtils.getDigest(oid.getSource(),
oid.getName().getByteArray(), digestFunction));
}
示例7: recomputeDigest
import com.google.ipc.invalidation.common.ObjectIdDigestUtils; //导入依赖的package包/类
/** Recomputes the digests over all objects and sets {@code this.digest}. */
private void recomputeDigest() {
this.digest = ObjectIdDigestUtils.getDigest(registrations.keySet(), digestFunction);
}
示例8: contains
import com.google.ipc.invalidation.common.ObjectIdDigestUtils; //导入依赖的package包/类
@Override
public boolean contains(ObjectIdP oid) {
return registrations.containsKey(ObjectIdDigestUtils.getDigest(oid, digestFunction));
}