本文整理汇总了Java中com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.InvalidateUpcall类的典型用法代码示例。如果您正苦于以下问题:Java InvalidateUpcall类的具体用法?Java InvalidateUpcall怎么用?Java InvalidateUpcall使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InvalidateUpcall类属于com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall包,在下文中一共展示了InvalidateUpcall类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: toCompactString
import com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.InvalidateUpcall; //导入依赖的package包/类
/** Appends a description of the given {@code invalidate} command to the given {@code builder}. */
public static TextBuilder toCompactString(TextBuilder builder,
InvalidateUpcall invalidate) {
if (invalidate == null) {
return builder;
}
builder.append("invalidate(ackHandle = ");
serializedAckHandleToCompactString(builder, invalidate.getAckHandle());
builder.append(", ");
if (invalidate.hasInvalidation()) {
CommonProtoStrings2.toCompactString(builder, invalidate.getInvalidation());
} else if (invalidate.getInvalidateAll()) {
builder.append("ALL");
} else if (invalidate.hasInvalidateUnknown()) {
builder.append("UNKNOWN: ");
CommonProtoStrings2.toCompactString(builder, invalidate.getInvalidateUnknown());
}
return builder.append(")");
}
开发者ID:morristech,项目名称:android-chromium,代码行数:20,代码来源:AndroidStrings.java
示例2: onInvalidateUpcall
import com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.InvalidateUpcall; //导入依赖的package包/类
/**
* Handles an invalidation-related listener {@code upcall} by dispatching to the appropriate
* method on an instance of {@link #listenerClass}.
*/
private void onInvalidateUpcall(ListenerUpcall upcall, InvalidationListener listener) {
InvalidateUpcall invalidate = upcall.getInvalidate();
AckHandle ackHandle = AckHandle.newInstance(invalidate.getAckHandle().toByteArray());
if (invalidate.hasInvalidation()) {
listener.invalidate(client,
ProtoConverter.convertFromInvalidationProto(invalidate.getInvalidation()),
ackHandle);
} else if (invalidate.hasInvalidateAll()) {
listener.invalidateAll(client, ackHandle);
} else if (invalidate.hasInvalidateUnknown()) {
listener.invalidateUnknownVersion(client,
ProtoConverter.convertFromObjectIdProto(invalidate.getInvalidateUnknown()), ackHandle);
} else {
throw new RuntimeException("Invalid invalidate upcall: " + invalidate);
}
}
开发者ID:morristech,项目名称:android-chromium,代码行数:21,代码来源:AndroidInvalidationListenerIntentMapper.java
示例3: hasField
import com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.InvalidateUpcall; //导入依赖的package包/类
/** Returns whether {@code field} is present in {@code message}. */
@Override
@SuppressWarnings("unchecked")
public boolean hasField(MessageLite rawMessage, Descriptor field) {
Preconditions.checkNotNull(rawMessage);
Preconditions.checkNotNull(field);
InvalidateUpcall message = (InvalidateUpcall) rawMessage;
if (field == ACK_HANDLE) {
return message.hasAckHandle();
}
if (field == INVALIDATION) {
return message.hasInvalidation();
}
if (field == INVALIDATE_UNKNOWN) {
return message.hasInvalidateUnknown();
}
if (field == INVALIDATE_ALL) {
return message.hasInvalidateAll();
}
throw new IllegalArgumentException("Bad descriptor: " + field);
}
开发者ID:morristech,项目名称:android-chromium,代码行数:22,代码来源:AndroidServiceAccessor.java
示例4: getField
import com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.InvalidateUpcall; //导入依赖的package包/类
/** Returns the {@code field} from {@code message}. */
@Override
@SuppressWarnings("unchecked")
public Object getField(MessageLite rawMessage, Descriptor field) {
Preconditions.checkNotNull(rawMessage);
Preconditions.checkNotNull(field);
InvalidateUpcall message = (InvalidateUpcall) rawMessage;
if (field == ACK_HANDLE) {
return message.getAckHandle();
}
if (field == INVALIDATION) {
return message.getInvalidation();
}
if (field == INVALIDATE_UNKNOWN) {
return message.getInvalidateUnknown();
}
if (field == INVALIDATE_ALL) {
return message.getInvalidateAll();
}
throw new IllegalArgumentException("Bad descriptor: " + field);
}
开发者ID:morristech,项目名称:android-chromium,代码行数:22,代码来源:AndroidServiceAccessor.java
示例5: newInvalidateIntent
import com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.InvalidateUpcall; //导入依赖的package包/类
public static Intent newInvalidateIntent(InvalidationP invalidation, AckHandleP ackHandle) {
Intent intent = new Intent();
InvalidateUpcall invUpcall = InvalidateUpcall.newBuilder()
.setAckHandle(ackHandle.toByteString())
.setInvalidation(invalidation).build();
intent.putExtra(LISTENER_UPCALL_KEY,
newBuilder().setInvalidate(invUpcall).build().toByteArray());
return intent;
}
开发者ID:morristech,项目名称:android-chromium,代码行数:10,代码来源:ProtocolIntents.java
示例6: newInvalidateUnknownIntent
import com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.InvalidateUpcall; //导入依赖的package包/类
public static Intent newInvalidateUnknownIntent(ObjectIdP object, AckHandleP ackHandle) {
Intent intent = new Intent();
InvalidateUpcall invUpcall = InvalidateUpcall.newBuilder()
.setAckHandle(ackHandle.toByteString())
.setInvalidateUnknown(object).build();
intent.putExtra(LISTENER_UPCALL_KEY,
newBuilder().setInvalidate(invUpcall).build().toByteArray());
return intent;
}
开发者ID:morristech,项目名称:android-chromium,代码行数:10,代码来源:ProtocolIntents.java
示例7: newInvalidateAllIntent
import com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.InvalidateUpcall; //导入依赖的package包/类
public static Intent newInvalidateAllIntent(AckHandleP ackHandle) {
Intent intent = new Intent();
InvalidateUpcall invUpcall = InvalidateUpcall.newBuilder()
.setAckHandle(ackHandle.toByteString())
.setInvalidateAll(true).build();
intent.putExtra(LISTENER_UPCALL_KEY,
newBuilder().setInvalidate(invUpcall).build().toByteArray());
return intent;
}
开发者ID:morristech,项目名称:android-chromium,代码行数:10,代码来源:ProtocolIntents.java
注:本文中的com.google.protos.ipc.invalidation.AndroidService.ListenerUpcall.InvalidateUpcall类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论