本文整理汇总了Java中com.google.protos.ipc.invalidation.AndroidService.InternalDowncall类的典型用法代码示例。如果您正苦于以下问题:Java InternalDowncall类的具体用法?Java InternalDowncall怎么用?Java InternalDowncall使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InternalDowncall类属于com.google.protos.ipc.invalidation.AndroidService包,在下文中一共展示了InternalDowncall类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toCompactString
import com.google.protos.ipc.invalidation.AndroidService.InternalDowncall; //导入依赖的package包/类
/** Appends a description of the given internal {@code downcall} to the given {@code builder}. */
public static TextBuilder toCompactString(TextBuilder builder,
InternalDowncall downcall) {
if (downcall == null) {
return builder;
}
builder.append(ProtocolIntents.INTERNAL_DOWNCALL_KEY).append("::");
if (downcall.hasServerMessage()) {
toCompactString(builder, downcall.getServerMessage());
} else if (downcall.hasNetworkStatus()) {
toCompactString(builder, downcall.getNetworkStatus());
} else if (downcall.hasNetworkAddrChange()) {
builder.append("newtworkAddrChange()");
} else if (downcall.hasCreateClient()) {
toCompactString(builder, downcall.getCreateClient());
} else {
builder.append(UNKNOWN_MESSAGE);
}
return builder;
}
示例2: hasField
import com.google.protos.ipc.invalidation.AndroidService.InternalDowncall; //导入依赖的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);
InternalDowncall message = (InternalDowncall) rawMessage;
if (field == VERSION) {
return message.hasVersion();
}
if (field == SERVER_MESSAGE) {
return message.hasServerMessage();
}
if (field == NETWORK_STATUS) {
return message.hasNetworkStatus();
}
if (field == NETWORK_ADDR_CHANGE) {
return message.hasNetworkAddrChange();
}
if (field == CREATE_CLIENT) {
return message.hasCreateClient();
}
throw new IllegalArgumentException("Bad descriptor: " + field);
}
示例3: getField
import com.google.protos.ipc.invalidation.AndroidService.InternalDowncall; //导入依赖的package包/类
/** Returns the {@code field} from {@code message}. */
@Override
@SuppressWarnings("unchecked")
public Object getField(MessageLite rawMessage, Descriptor field) {
Preconditions.checkNotNull(rawMessage);
Preconditions.checkNotNull(field);
InternalDowncall message = (InternalDowncall) rawMessage;
if (field == VERSION) {
return message.getVersion();
}
if (field == SERVER_MESSAGE) {
return message.getServerMessage();
}
if (field == NETWORK_STATUS) {
return message.getNetworkStatus();
}
if (field == NETWORK_ADDR_CHANGE) {
return message.getNetworkAddrChange();
}
if (field == CREATE_CLIENT) {
return message.getCreateClient();
}
throw new IllegalArgumentException("Bad descriptor: " + field);
}
示例4: newBuilder
import com.google.protos.ipc.invalidation.AndroidService.InternalDowncall; //导入依赖的package包/类
private static InternalDowncall.Builder newBuilder() {
return InternalDowncall.newBuilder().setVersion(ANDROID_PROTOCOL_VERSION_VALUE);
}
示例5: isInternalDowncallValid
import com.google.protos.ipc.invalidation.AndroidService.InternalDowncall; //导入依赖的package包/类
/** Returns whether {@code downcall} has a valid set of fields with valid values. */
boolean isInternalDowncallValid(InternalDowncall downcall) {
return checkMessage(downcall, InternalDowncallInfos.INTERNAL_DOWNCALL_MSG);
}
示例6: tryParseExtra
import com.google.protos.ipc.invalidation.AndroidService.InternalDowncall; //导入依赖的package包/类
/** Appends a description of any known extra or appends 'UNKNOWN' if none are recognized. */
private static boolean tryParseExtra(TextBuilder builder, Intent intent)
throws InvalidProtocolBufferException {
byte[] data;
data = intent.getByteArrayExtra(ProtocolIntents.SCHEDULER_KEY);
if (data != null) {
AndroidSchedulerEvent schedulerEvent = AndroidSchedulerEvent.parseFrom(data);
toCompactString(builder, schedulerEvent);
return true;
}
data = intent.getByteArrayExtra(ProtocolIntents.OUTBOUND_MESSAGE_KEY);
if (data != null) {
AndroidNetworkSendRequest outboundMessage = AndroidNetworkSendRequest.parseFrom(data);
toCompactString(builder, outboundMessage);
return true;
}
data = intent.getByteArrayExtra(ProtocolIntents.LISTENER_UPCALL_KEY);
if (data != null) {
ListenerUpcall upcall = ListenerUpcall.parseFrom(data);
toCompactString(builder, upcall);
return true;
}
data = intent.getByteArrayExtra(ProtocolIntents.INTERNAL_DOWNCALL_KEY);
if (data != null) {
InternalDowncall internalDowncall = InternalDowncall.parseFrom(data);
toCompactString(builder, internalDowncall);
return true;
}
data = intent.getByteArrayExtra(ProtocolIntents.CLIENT_DOWNCALL_KEY);
if (data != null) {
ClientDowncall clientDowncall = ClientDowncall.parseFrom(data);
toCompactString(builder, clientDowncall);
return true;
}
// Didn't recognize any intents.
return false;
}