本文整理汇总了Java中com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders方法的典型用法代码示例。如果您正苦于以下问题:Java GeneratedMessage.alwaysUseFieldBuilders方法的具体用法?Java GeneratedMessage.alwaysUseFieldBuilders怎么用?Java GeneratedMessage.alwaysUseFieldBuilders使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.protobuf.GeneratedMessage
的用法示例。
在下文中一共展示了GeneratedMessage.alwaysUseFieldBuilders方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mergeFrom
import com.google.protobuf.GeneratedMessage; //导入方法依赖的package包/类
public Builder mergeFrom(MumbleProto.Mumble.BanList other) {
if (other == MumbleProto.Mumble.BanList.getDefaultInstance()) return this;
if (bansBuilder_ == null) {
if (!other.bans_.isEmpty()) {
if (bans_.isEmpty()) {
bans_ = other.bans_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureBansIsMutable();
bans_.addAll(other.bans_);
}
onChanged();
}
} else {
if (!other.bans_.isEmpty()) {
if (bansBuilder_.isEmpty()) {
bansBuilder_.dispose();
bansBuilder_ = null;
bans_ = other.bans_;
bitField0_ = (bitField0_ & ~0x00000001);
bansBuilder_ =
GeneratedMessage.alwaysUseFieldBuilders ?
getBansFieldBuilder() : null;
} else {
bansBuilder_.addAllMessages(other.bans_);
}
}
}
if (other.hasQuery()) {
setQuery(other.getQuery());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
示例2: maybeForceBuilderInitialization
import com.google.protobuf.GeneratedMessage; //导入方法依赖的package包/类
private void maybeForceBuilderInitialization() {
if (GeneratedMessage.alwaysUseFieldBuilders) {
}
}