Java 类com.google.protobuf.GeneratedMessage.GeneratedExtension 实例源码

项目:coyote    文件:ProtobufServiceTranslator.java   
public RpcRequestResponse translate(MethodDescriptor method, Message message,
    StreamCarryingRpcController controller) {
  // first convert the request to an RPC request
  Rpc.Builder msg = makeHeader(method.getName());
  // add the request to the header
  GeneratedExtension<Rpc, Message> extension = extensions.getExtension(message);
  msg.setExtension(extension, message);

  // then create the actual rpc that will be sent
  RpcRequestResponse rpc = new RpcRequestResponse(msg);
  if (controller != null && controller.getOutboundTrailer() != null) {
    rpc.setData(controller.getOutboundTrailer(), controller.getOutboundTrailerLength());
  }

  return rpc;
}
项目:bazel    文件:PseudoAction.java   
public PseudoAction(UUID uuid, ActionOwner owner,
    NestedSet<Artifact> inputs, Collection<Artifact> outputs,
    String mnemonic,
    GeneratedExtension<ExtraActionInfo, InfoType> infoExtension, InfoType info) {
  super(owner, inputs, outputs);
  this.uuid = uuid;
  this.mnemonic = mnemonic;
  this.infoExtension = infoExtension;
  this.info = info;
}
项目:bazel    文件:PyCommon.java   
public PyPseudoAction(ActionOwner owner,
    NestedSet<Artifact> inputs, Collection<Artifact> outputs,
    String mnemonic, GeneratedExtension<ExtraActionInfo, PythonInfo> infoExtension,
    PythonInfo info) {
  super(ACTION_UUID, owner, inputs, outputs, mnemonic, infoExtension, info);
}
项目:bazel    文件:SpawnAction.java   
protected ExtraActionInfoSupplier(GeneratedExtension<ExtraActionInfo, T> extension, T value) {
  this.extension = extension;
  this.value = value;
}
项目:bazel    文件:SpawnAction.java   
public <T> Builder setExtraActionInfo(
    GeneratedExtension<ExtraActionInfo, T> extension, T value) {
  this.extraActionInfoSupplier = new ExtraActionInfoSupplier<>(extension, value);
  return this;
}
项目:bazel    文件:GeneratedMessageV3.java   
/** Check if a singular extension is present. */
<Type> boolean hasExtension(
    GeneratedExtension<MessageType, Type> extension);
项目:bazel    文件:GeneratedMessageV3.java   
/** Get the number of elements in a repeated extension. */
<Type> int getExtensionCount(
    GeneratedExtension<MessageType, List<Type>> extension);
项目:bazel    文件:GeneratedMessageV3.java   
/** Get the value of an extension. */
<Type> Type getExtension(
    GeneratedExtension<MessageType, Type> extension);
项目:bazel    文件:GeneratedMessageV3.java   
/** Get one element of a repeated extension. */
<Type> Type getExtension(
    GeneratedExtension<MessageType, List<Type>> extension,
    int index);
项目:bazel    文件:GeneratedMessageV3.java   
/** Check if a singular extension is present. */
@Override
public final <Type> boolean hasExtension(
    final GeneratedExtension<MessageType, Type> extension) {
  return hasExtension((ExtensionLite<MessageType, Type>) extension);
}
项目:bazel    文件:GeneratedMessageV3.java   
/** Get the number of elements in a repeated extension. */
@Override
public final <Type> int getExtensionCount(
    final GeneratedExtension<MessageType, List<Type>> extension) {
  return getExtensionCount((ExtensionLite<MessageType, List<Type>>) extension);
}
项目:bazel    文件:GeneratedMessageV3.java   
/** Get the value of an extension. */
@Override
public final <Type> Type getExtension(
    final GeneratedExtension<MessageType, Type> extension) {
  return getExtension((ExtensionLite<MessageType, Type>) extension);
}
项目:bazel    文件:GeneratedMessageV3.java   
/** Get one element of a repeated extension. */
@Override
public final <Type> Type getExtension(
    final GeneratedExtension<MessageType, List<Type>> extension, final int index) {
  return getExtension((ExtensionLite<MessageType, List<Type>>) extension, index);
}
项目:bazel    文件:GeneratedMessageV3.java   
/** Check if a singular extension is present. */
@Override
public final <Type> boolean hasExtension(
    final GeneratedExtension<MessageType, Type> extension) {
  return hasExtension((ExtensionLite<MessageType, Type>) extension);
}
项目:bazel    文件:GeneratedMessageV3.java   
/** Get the number of elements in a repeated extension. */
@Override
public final <Type> int getExtensionCount(
    final GeneratedExtension<MessageType, List<Type>> extension) {
  return getExtensionCount((ExtensionLite<MessageType, List<Type>>) extension);
}
项目:bazel    文件:GeneratedMessageV3.java   
/** Get the value of an extension. */
@Override
public final <Type> Type getExtension(
    final GeneratedExtension<MessageType, Type> extension) {
  return getExtension((ExtensionLite<MessageType, Type>) extension);
}
项目:bazel    文件:GeneratedMessageV3.java   
/** Get the value of an extension. */
@Override
public final <Type> Type getExtension(
    final GeneratedExtension<MessageType, List<Type>> extension, final int index) {
  return getExtension((ExtensionLite<MessageType, List<Type>>) extension, index);
}
项目:bazel    文件:GeneratedMessageV3.java   
/** Set the value of an extension. */
public <Type> BuilderType setExtension(
    final GeneratedExtension<MessageType, Type> extension, final Type value) {
  return setExtension((ExtensionLite<MessageType, Type>) extension, value);
}
项目:bazel    文件:GeneratedMessageV3.java   
/** Set the value of one element of a repeated extension. */
public <Type> BuilderType setExtension(
    final GeneratedExtension<MessageType, List<Type>> extension,
    final int index, final Type value) {
  return setExtension((ExtensionLite<MessageType, List<Type>>) extension, index, value);
}
项目:bazel    文件:GeneratedMessageV3.java   
/** Append a value to a repeated extension. */
public <Type> BuilderType addExtension(
    final GeneratedExtension<MessageType, List<Type>> extension, final Type value) {
  return addExtension((ExtensionLite<MessageType, List<Type>>) extension, value);
}
项目:bazel    文件:GeneratedMessageV3.java   
/** Clear an extension. */
public <Type> BuilderType clearExtension(
    final GeneratedExtension<MessageType, ?> extension) {
  return clearExtension((ExtensionLite<MessageType, ?>) extension);
}
项目:openrtb    文件:Test2Reader.java   
public Test2Reader(GeneratedExtension<?, ?> key, String name) {
  super(key, true, name);
}
项目:openrtb    文件:Test1Reader.java   
public Test1Reader(GeneratedExtension<?, ?> key) {
  super(key, false, "test1");
}
项目:coyote    文件:ProtobufServiceTranslator.java   
/**
 * Translate from the external RPC message to the actual message embedded as an extension in
 * the Rpc message
 *
 * @param receivedMessage generic RPC received
 * @param prototype prototype of the message that we expect to receive
 * @return the twice wrapped underlying rpc message
 */
public Message translate(Rpc rpc, Message prototype) {
  // unwrap the underlying message, which should be bound to one of the extensions
  GeneratedMessage.GeneratedExtension<RpcMessages.Rpc, Message> responseExtension =
      extensions.getExtension(prototype);
  return rpc.getExtension(responseExtension);
}
项目:openrtb    文件:OpenRtbJsonExtComplexReader.java   
/**
 * Use this constructor for readers of message type.
 *
 * @param key Extension key
 * @param isJsonObject {@code true} if the extension value is desserialized from a JSON object
 * @param rootNameFilters Filter for the root names (direct fields of "ext").
 *     If empty, this reader will be invoked for any field.
 */
protected OpenRtbJsonExtComplexReader(
    GeneratedExtension<?, ?> key, boolean isJsonObject, String... rootNameFilters) {
  super(rootNameFilters);
  this.key = checkNotNull(key);
  this.isJsonObject = isJsonObject;
}