text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: grpc/gcp/handshaker.proto

package io.grpc.alts.internal;

/**
 * Protobuf type {@code grpc.gcp.HandshakerResult}
 */
public  final class HandshakerResult extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:grpc.gcp.HandshakerResult)
    HandshakerResultOrBuilder {
private static final long serialVersionUID = 0L;
  // Use HandshakerResult.newBuilder() to construct.
  private HandshakerResult(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private HandshakerResult() {
    applicationProtocol_ = "";
    recordProtocol_ = "";
    keyData_ = com.google.protobuf.ByteString.EMPTY;
    keepChannelOpen_ = false;
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private HandshakerResult(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();

            applicationProtocol_ = s;
            break;
          }
          case 18: {
            java.lang.String s = input.readStringRequireUtf8();

            recordProtocol_ = s;
            break;
          }
          case 26: {

            keyData_ = input.readBytes();
            break;
          }
          case 34: {
            io.grpc.alts.internal.Identity.Builder subBuilder = null;
            if (peerIdentity_ != null) {
              subBuilder = peerIdentity_.toBuilder();
            }
            peerIdentity_ = input.readMessage(io.grpc.alts.internal.Identity.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(peerIdentity_);
              peerIdentity_ = subBuilder.buildPartial();
            }

            break;
          }
          case 42: {
            io.grpc.alts.internal.Identity.Builder subBuilder = null;
            if (localIdentity_ != null) {
              subBuilder = localIdentity_.toBuilder();
            }
            localIdentity_ = input.readMessage(io.grpc.alts.internal.Identity.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(localIdentity_);
              localIdentity_ = subBuilder.buildPartial();
            }

            break;
          }
          case 48: {

            keepChannelOpen_ = input.readBool();
            break;
          }
          case 58: {
            io.grpc.alts.internal.RpcProtocolVersions.Builder subBuilder = null;
            if (peerRpcVersions_ != null) {
              subBuilder = peerRpcVersions_.toBuilder();
            }
            peerRpcVersions_ = input.readMessage(io.grpc.alts.internal.RpcProtocolVersions.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(peerRpcVersions_);
              peerRpcVersions_ = subBuilder.buildPartial();
            }

            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return io.grpc.alts.internal.HandshakerProto.internal_static_grpc_gcp_HandshakerResult_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return io.grpc.alts.internal.HandshakerProto.internal_static_grpc_gcp_HandshakerResult_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            io.grpc.alts.internal.HandshakerResult.class, io.grpc.alts.internal.HandshakerResult.Builder.class);
  }

  public static final int APPLICATION_PROTOCOL_FIELD_NUMBER = 1;
  private volatile java.lang.Object applicationProtocol_;
  /**
   *

   * The application protocol negotiated for this connection.
   *

   *
   * string application_protocol = 1;
   */
  public java.lang.String getApplicationProtocol() {
    java.lang.Object ref = applicationProtocol_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs =
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      applicationProtocol_ = s;
      return s;
    }
  }
  /**
   *

   * The application protocol negotiated for this connection.
   *

   *
   * string application_protocol = 1;
   */
  public com.google.protobuf.ByteString
      getApplicationProtocolBytes() {
    java.lang.Object ref = applicationProtocol_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      applicationProtocol_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int RECORD_PROTOCOL_FIELD_NUMBER = 2;
  private volatile java.lang.Object recordProtocol_;
  /**
   *

   * The record protocol negotiated for this connection.
   *

   *
   * string record_protocol = 2;
   */
  public java.lang.String getRecordProtocol() {
    java.lang.Object ref = recordProtocol_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs =
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      recordProtocol_ = s;
      return s;
    }
  }
  /**
   *

   * The record protocol negotiated for this connection.
   *

   *
   * string record_protocol = 2;
   */
  public com.google.protobuf.ByteString
      getRecordProtocolBytes() {
    java.lang.Object ref = recordProtocol_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      recordProtocol_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int KEY_DATA_FIELD_NUMBER = 3;
  private com.google.protobuf.ByteString keyData_;
  /**
   *

   * Cryptographic key data. The key data may be more than the key length
   * required for the record protocol, thus the client of the handshaker
   * service needs to truncate the key data into the right key length.
   *

   *
   * bytes key_data = 3;
   */
  public com.google.protobuf.ByteString getKeyData() {
    return keyData_;
  }

  public static final int PEER_IDENTITY_FIELD_NUMBER = 4;
  private io.grpc.alts.internal.Identity peerIdentity_;
  /**
   *

   * The authenticated identity of the peer.
   *

   *
   * .grpc.gcp.Identity peer_identity = 4;
   */
  public boolean hasPeerIdentity() {
    return peerIdentity_ != null;
  }
  /**
   *

   * The authenticated identity of the peer.
   *

   *
   * .grpc.gcp.Identity peer_identity = 4;
   */
  public io.grpc.alts.internal.Identity getPeerIdentity() {
    return peerIdentity_ == null ? io.grpc.alts.internal.Identity.getDefaultInstance() : peerIdentity_;
  }
  /**
   *

   * The authenticated identity of the peer.
   *

   *
   * .grpc.gcp.Identity peer_identity = 4;
   */
  public io.grpc.alts.internal.IdentityOrBuilder getPeerIdentityOrBuilder() {
    return getPeerIdentity();
  }

  public static final int LOCAL_IDENTITY_FIELD_NUMBER = 5;
  private io.grpc.alts.internal.Identity localIdentity_;
  /**
   *

   * The local identity used in the handshake.
   *

   *
   * .grpc.gcp.Identity local_identity = 5;
   */
  public boolean hasLocalIdentity() {
    return localIdentity_ != null;
  }
  /**
   *

   * The local identity used in the handshake.
   *

   *
   * .grpc.gcp.Identity local_identity = 5;
   */
  public io.grpc.alts.internal.Identity getLocalIdentity() {
    return localIdentity_ == null ? io.grpc.alts.internal.Identity.getDefaultInstance() : localIdentity_;
  }
  /**
   *

   * The local identity used in the handshake.
   *

   *
   * .grpc.gcp.Identity local_identity = 5;
   */
  public io.grpc.alts.internal.IdentityOrBuilder getLocalIdentityOrBuilder() {
    return getLocalIdentity();
  }

  public static final int KEEP_CHANNEL_OPEN_FIELD_NUMBER = 6;
  private boolean keepChannelOpen_;
  /**
   *

   * Indicate whether the handshaker service client should keep the channel
   * between the handshaker service open, e.g., in order to handle
   * post-handshake messages in the future.
   *

   *
   * bool keep_channel_open = 6;
   */
  public boolean getKeepChannelOpen() {
    return keepChannelOpen_;
  }

  public static final int PEER_RPC_VERSIONS_FIELD_NUMBER = 7;
  private io.grpc.alts.internal.RpcProtocolVersions peerRpcVersions_;
  /**
   *

   * The RPC protocol versions supported by the peer.
   *

   *
   * .grpc.gcp.RpcProtocolVersions peer_rpc_versions = 7;
   */
  public boolean hasPeerRpcVersions() {
    return peerRpcVersions_ != null;
  }
  /**
   *

   * The RPC protocol versions supported by the peer.
   *

   *
   * .grpc.gcp.RpcProtocolVersions peer_rpc_versions = 7;
   */
  public io.grpc.alts.internal.RpcProtocolVersions getPeerRpcVersions() {
    return peerRpcVersions_ == null ? io.grpc.alts.internal.RpcProtocolVersions.getDefaultInstance() : peerRpcVersions_;
  }
  /**
   *

   * The RPC protocol versions supported by the peer.
   *

   *
   * .grpc.gcp.RpcProtocolVersions peer_rpc_versions = 7;
   */
  public io.grpc.alts.internal.RpcProtocolVersionsOrBuilder getPeerRpcVersionsOrBuilder() {
    return getPeerRpcVersions();
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getApplicationProtocolBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, applicationProtocol_);
    }
    if (!getRecordProtocolBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, recordProtocol_);
    }
    if (!keyData_.isEmpty()) {
      output.writeBytes(3, keyData_);
    }
    if (peerIdentity_ != null) {
      output.writeMessage(4, getPeerIdentity());
    }
    if (localIdentity_ != null) {
      output.writeMessage(5, getLocalIdentity());
    }
    if (keepChannelOpen_ != false) {
      output.writeBool(6, keepChannelOpen_);
    }
    if (peerRpcVersions_ != null) {
      output.writeMessage(7, getPeerRpcVersions());
    }
    unknownFields.writeTo(output);
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getApplicationProtocolBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, applicationProtocol_);
    }
    if (!getRecordProtocolBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, recordProtocol_);
    }
    if (!keyData_.isEmpty()) {
      size += com.google.protobuf.CodedOutputStream
        .computeBytesSize(3, keyData_);
    }
    if (peerIdentity_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getPeerIdentity());
    }
    if (localIdentity_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getLocalIdentity());
    }
    if (keepChannelOpen_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(6, keepChannelOpen_);
    }
    if (peerRpcVersions_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(7, getPeerRpcVersions());
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof io.grpc.alts.internal.HandshakerResult)) {
      return super.equals(obj);
    }
    io.grpc.alts.internal.HandshakerResult other = (io.grpc.alts.internal.HandshakerResult) obj;

    boolean result = true;
    result = result && getApplicationProtocol()
        .equals(other.getApplicationProtocol());
    result = result && getRecordProtocol()
        .equals(other.getRecordProtocol());
    result = result && getKeyData()
        .equals(other.getKeyData());
    result = result && (hasPeerIdentity() == other.hasPeerIdentity());
    if (hasPeerIdentity()) {
      result = result && getPeerIdentity()
          .equals(other.getPeerIdentity());
    }
    result = result && (hasLocalIdentity() == other.hasLocalIdentity());
    if (hasLocalIdentity()) {
      result = result && getLocalIdentity()
          .equals(other.getLocalIdentity());
    }
    result = result && (getKeepChannelOpen()
        == other.getKeepChannelOpen());
    result = result && (hasPeerRpcVersions() == other.hasPeerRpcVersions());
    if (hasPeerRpcVersions()) {
      result = result && getPeerRpcVersions()
          .equals(other.getPeerRpcVersions());
    }
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + APPLICATION_PROTOCOL_FIELD_NUMBER;
    hash = (53 * hash) + getApplicationProtocol().hashCode();
    hash = (37 * hash) + RECORD_PROTOCOL_FIELD_NUMBER;
    hash = (53 * hash) + getRecordProtocol().hashCode();
    hash = (37 * hash) + KEY_DATA_FIELD_NUMBER;
    hash = (53 * hash) + getKeyData().hashCode();
    if (hasPeerIdentity()) {
      hash = (37 * hash) + PEER_IDENTITY_FIELD_NUMBER;
      hash = (53 * hash) + getPeerIdentity().hashCode();
    }
    if (hasLocalIdentity()) {
      hash = (37 * hash) + LOCAL_IDENTITY_FIELD_NUMBER;
      hash = (53 * hash) + getLocalIdentity().hashCode();
    }
    hash = (37 * hash) + KEEP_CHANNEL_OPEN_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getKeepChannelOpen());
    if (hasPeerRpcVersions()) {
      hash = (37 * hash) + PEER_RPC_VERSIONS_FIELD_NUMBER;
      hash = (53 * hash) + getPeerRpcVersions().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static io.grpc.alts.internal.HandshakerResult parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static io.grpc.alts.internal.HandshakerResult parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static io.grpc.alts.internal.HandshakerResult parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static io.grpc.alts.internal.HandshakerResult parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static io.grpc.alts.internal.HandshakerResult parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static io.grpc.alts.internal.HandshakerResult parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static io.grpc.alts.internal.HandshakerResult parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static io.grpc.alts.internal.HandshakerResult parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static io.grpc.alts.internal.HandshakerResult parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static io.grpc.alts.internal.HandshakerResult parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static io.grpc.alts.internal.HandshakerResult parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static io.grpc.alts.internal.HandshakerResult parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(io.grpc.alts.internal.HandshakerResult prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * Protobuf type {@code grpc.gcp.HandshakerResult}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:grpc.gcp.HandshakerResult)
      io.grpc.alts.internal.HandshakerResultOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return io.grpc.alts.internal.HandshakerProto.internal_static_grpc_gcp_HandshakerResult_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return io.grpc.alts.internal.HandshakerProto.internal_static_grpc_gcp_HandshakerResult_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              io.grpc.alts.internal.HandshakerResult.class, io.grpc.alts.internal.HandshakerResult.Builder.class);
    }

    // Construct using io.grpc.alts.internal.HandshakerResult.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    public Builder clear() {
      super.clear();
      applicationProtocol_ = "";

      recordProtocol_ = "";

      keyData_ = com.google.protobuf.ByteString.EMPTY;

      if (peerIdentityBuilder_ == null) {
        peerIdentity_ = null;
      } else {
        peerIdentity_ = null;
        peerIdentityBuilder_ = null;
      }
      if (localIdentityBuilder_ == null) {
        localIdentity_ = null;
      } else {
        localIdentity_ = null;
        localIdentityBuilder_ = null;
      }
      keepChannelOpen_ = false;

      if (peerRpcVersionsBuilder_ == null) {
        peerRpcVersions_ = null;
      } else {
        peerRpcVersions_ = null;
        peerRpcVersionsBuilder_ = null;
      }
      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return io.grpc.alts.internal.HandshakerProto.internal_static_grpc_gcp_HandshakerResult_descriptor;
    }

    public io.grpc.alts.internal.HandshakerResult getDefaultInstanceForType() {
      return io.grpc.alts.internal.HandshakerResult.getDefaultInstance();
    }

    public io.grpc.alts.internal.HandshakerResult build() {
      io.grpc.alts.internal.HandshakerResult result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public io.grpc.alts.internal.HandshakerResult buildPartial() {
      io.grpc.alts.internal.HandshakerResult result = new io.grpc.alts.internal.HandshakerResult(this);
      result.applicationProtocol_ = applicationProtocol_;
      result.recordProtocol_ = recordProtocol_;
      result.keyData_ = keyData_;
      if (peerIdentityBuilder_ == null) {
        result.peerIdentity_ = peerIdentity_;
      } else {
        result.peerIdentity_ = peerIdentityBuilder_.build();
      }
      if (localIdentityBuilder_ == null) {
        result.localIdentity_ = localIdentity_;
      } else {
        result.localIdentity_ = localIdentityBuilder_.build();
      }
      result.keepChannelOpen_ = keepChannelOpen_;
      if (peerRpcVersionsBuilder_ == null) {
        result.peerRpcVersions_ = peerRpcVersions_;
      } else {
        result.peerRpcVersions_ = peerRpcVersionsBuilder_.build();
      }
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof io.grpc.alts.internal.HandshakerResult) {
        return mergeFrom((io.grpc.alts.internal.HandshakerResult)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(io.grpc.alts.internal.HandshakerResult other) {
      if (other == io.grpc.alts.internal.HandshakerResult.getDefaultInstance()) return this;
      if (!other.getApplicationProtocol().isEmpty()) {
        applicationProtocol_ = other.applicationProtocol_;
        onChanged();
      }
      if (!other.getRecordProtocol().isEmpty()) {
        recordProtocol_ = other.recordProtocol_;
        onChanged();
      }
      if (other.getKeyData() != com.google.protobuf.ByteString.EMPTY) {
        setKeyData(other.getKeyData());
      }
      if (other.hasPeerIdentity()) {
        mergePeerIdentity(other.getPeerIdentity());
      }
      if (other.hasLocalIdentity()) {
        mergeLocalIdentity(other.getLocalIdentity());
      }
      if (other.getKeepChannelOpen() != false) {
        setKeepChannelOpen(other.getKeepChannelOpen());
      }
      if (other.hasPeerRpcVersions()) {
        mergePeerRpcVersions(other.getPeerRpcVersions());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      io.grpc.alts.internal.HandshakerResult parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (io.grpc.alts.internal.HandshakerResult) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object applicationProtocol_ = "";
    /**
     *

     * The application protocol negotiated for this connection.
     *

     *
     * string application_protocol = 1;
     */
    public java.lang.String getApplicationProtocol() {
      java.lang.Object ref = applicationProtocol_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        applicationProtocol_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *

     * The application protocol negotiated for this connection.
     *

     *
     * string application_protocol = 1;
     */
    public com.google.protobuf.ByteString
        getApplicationProtocolBytes() {
      java.lang.Object ref = applicationProtocol_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        applicationProtocol_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *

     * The application protocol negotiated for this connection.
     *

     *
     * string application_protocol = 1;
     */
    public Builder setApplicationProtocol(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }

      applicationProtocol_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * The application protocol negotiated for this connection.
     *

     *
     * string application_protocol = 1;
     */
    public Builder clearApplicationProtocol() {

      applicationProtocol_ = getDefaultInstance().getApplicationProtocol();
      onChanged();
      return this;
    }
    /**
     *

     * The application protocol negotiated for this connection.
     *

     *
     * string application_protocol = 1;
     */
    public Builder setApplicationProtocolBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

      applicationProtocol_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object recordProtocol_ = "";
    /**
     *

     * The record protocol negotiated for this connection.
     *

     *
     * string record_protocol = 2;
     */
    public java.lang.String getRecordProtocol() {
      java.lang.Object ref = recordProtocol_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        recordProtocol_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *

     * The record protocol negotiated for this connection.
     *

     *
     * string record_protocol = 2;
     */
    public com.google.protobuf.ByteString
        getRecordProtocolBytes() {
      java.lang.Object ref = recordProtocol_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        recordProtocol_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *

     * The record protocol negotiated for this connection.
     *

     *
     * string record_protocol = 2;
     */
    public Builder setRecordProtocol(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }

      recordProtocol_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * The record protocol negotiated for this connection.
     *

     *
     * string record_protocol = 2;
     */
    public Builder clearRecordProtocol() {

      recordProtocol_ = getDefaultInstance().getRecordProtocol();
      onChanged();
      return this;
    }
    /**
     *

     * The record protocol negotiated for this connection.
     *

     *
     * string record_protocol = 2;
     */
    public Builder setRecordProtocolBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

      recordProtocol_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.ByteString keyData_ = com.google.protobuf.ByteString.EMPTY;
    /**
     *

     * Cryptographic key data. The key data may be more than the key length
     * required for the record protocol, thus the client of the handshaker
     * service needs to truncate the key data into the right key length.
     *

     *
     * bytes key_data = 3;
     */
    public com.google.protobuf.ByteString getKeyData() {
      return keyData_;
    }
    /**
     *

     * Cryptographic key data. The key data may be more than the key length
     * required for the record protocol, thus the client of the handshaker
     * service needs to truncate the key data into the right key length.
     *

     *
     * bytes key_data = 3;
     */
    public Builder setKeyData(com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }

      keyData_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * Cryptographic key data. The key data may be more than the key length
     * required for the record protocol, thus the client of the handshaker
     * service needs to truncate the key data into the right key length.
     *

     *
     * bytes key_data = 3;
     */
    public Builder clearKeyData() {

      keyData_ = getDefaultInstance().getKeyData();
      onChanged();
      return this;
    }

    private io.grpc.alts.internal.Identity peerIdentity_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        io.grpc.alts.internal.Identity, io.grpc.alts.internal.Identity.Builder, io.grpc.alts.internal.IdentityOrBuilder> peerIdentityBuilder_;
    /**
     *

     * The authenticated identity of the peer.
     *

     *
     * .grpc.gcp.Identity peer_identity = 4;
     */
    public boolean hasPeerIdentity() {
      return peerIdentityBuilder_ != null || peerIdentity_ != null;
    }
    /**
     *

     * The authenticated identity of the peer.
     *

     *
     * .grpc.gcp.Identity peer_identity = 4;
     */
    public io.grpc.alts.internal.Identity getPeerIdentity() {
      if (peerIdentityBuilder_ == null) {
        return peerIdentity_ == null ? io.grpc.alts.internal.Identity.getDefaultInstance() : peerIdentity_;
      } else {
        return peerIdentityBuilder_.getMessage();
      }
    }
    /**
     *

     * The authenticated identity of the peer.
     *

     *
     * .grpc.gcp.Identity peer_identity = 4;
     */
    public Builder setPeerIdentity(io.grpc.alts.internal.Identity value) {
      if (peerIdentityBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        peerIdentity_ = value;
        onChanged();
      } else {
        peerIdentityBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *

     * The authenticated identity of the peer.
     *

     *
     * .grpc.gcp.Identity peer_identity = 4;
     */
    public Builder setPeerIdentity(
        io.grpc.alts.internal.Identity.Builder builderForValue) {
      if (peerIdentityBuilder_ == null) {
        peerIdentity_ = builderForValue.build();
        onChanged();
      } else {
        peerIdentityBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *

     * The authenticated identity of the peer.
     *

     *
     * .grpc.gcp.Identity peer_identity = 4;
     */
    public Builder mergePeerIdentity(io.grpc.alts.internal.Identity value) {
      if (peerIdentityBuilder_ == null) {
        if (peerIdentity_ != null) {
          peerIdentity_ =
            io.grpc.alts.internal.Identity.newBuilder(peerIdentity_).mergeFrom(value).buildPartial();
        } else {
          peerIdentity_ = value;
        }
        onChanged();
      } else {
        peerIdentityBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *

     * The authenticated identity of the peer.
     *

     *
     * .grpc.gcp.Identity peer_identity = 4;
     */
    public Builder clearPeerIdentity() {
      if (peerIdentityBuilder_ == null) {
        peerIdentity_ = null;
        onChanged();
      } else {
        peerIdentity_ = null;
        peerIdentityBuilder_ = null;
      }

      return this;
    }
    /**
     *

     * The authenticated identity of the peer.
     *

     *
     * .grpc.gcp.Identity peer_identity = 4;
     */
    public io.grpc.alts.internal.Identity.Builder getPeerIdentityBuilder() {

      onChanged();
      return getPeerIdentityFieldBuilder().getBuilder();
    }
    /**
     *

     * The authenticated identity of the peer.
     *

     *
     * .grpc.gcp.Identity peer_identity = 4;
     */
    public io.grpc.alts.internal.IdentityOrBuilder getPeerIdentityOrBuilder() {
      if (peerIdentityBuilder_ != null) {
        return peerIdentityBuilder_.getMessageOrBuilder();
      } else {
        return peerIdentity_ == null ?
            io.grpc.alts.internal.Identity.getDefaultInstance() : peerIdentity_;
      }
    }
    /**
     *

     * The authenticated identity of the peer.
     *

     *
     * .grpc.gcp.Identity peer_identity = 4;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        io.grpc.alts.internal.Identity, io.grpc.alts.internal.Identity.Builder, io.grpc.alts.internal.IdentityOrBuilder>
        getPeerIdentityFieldBuilder() {
      if (peerIdentityBuilder_ == null) {
        peerIdentityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            io.grpc.alts.internal.Identity, io.grpc.alts.internal.Identity.Builder, io.grpc.alts.internal.IdentityOrBuilder>(
                getPeerIdentity(),
                getParentForChildren(),
                isClean());
        peerIdentity_ = null;
      }
      return peerIdentityBuilder_;
    }

    private io.grpc.alts.internal.Identity localIdentity_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        io.grpc.alts.internal.Identity, io.grpc.alts.internal.Identity.Builder, io.grpc.alts.internal.IdentityOrBuilder> localIdentityBuilder_;
    /**
     *

     * The local identity used in the handshake.
     *

     *
     * .grpc.gcp.Identity local_identity = 5;
     */
    public boolean hasLocalIdentity() {
      return localIdentityBuilder_ != null || localIdentity_ != null;
    }
    /**
     *

     * The local identity used in the handshake.
     *

     *
     * .grpc.gcp.Identity local_identity = 5;
     */
    public io.grpc.alts.internal.Identity getLocalIdentity() {
      if (localIdentityBuilder_ == null) {
        return localIdentity_ == null ? io.grpc.alts.internal.Identity.getDefaultInstance() : localIdentity_;
      } else {
        return localIdentityBuilder_.getMessage();
      }
    }
    /**
     *

     * The local identity used in the handshake.
     *

     *
     * .grpc.gcp.Identity local_identity = 5;
     */
    public Builder setLocalIdentity(io.grpc.alts.internal.Identity value) {
      if (localIdentityBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        localIdentity_ = value;
        onChanged();
      } else {
        localIdentityBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *

     * The local identity used in the handshake.
     *

     *
     * .grpc.gcp.Identity local_identity = 5;
     */
    public Builder setLocalIdentity(
        io.grpc.alts.internal.Identity.Builder builderForValue) {
      if (localIdentityBuilder_ == null) {
        localIdentity_ = builderForValue.build();
        onChanged();
      } else {
        localIdentityBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *

     * The local identity used in the handshake.
     *

     *
     * .grpc.gcp.Identity local_identity = 5;
     */
    public Builder mergeLocalIdentity(io.grpc.alts.internal.Identity value) {
      if (localIdentityBuilder_ == null) {
        if (localIdentity_ != null) {
          localIdentity_ =
            io.grpc.alts.internal.Identity.newBuilder(localIdentity_).mergeFrom(value).buildPartial();
        } else {
          localIdentity_ = value;
        }
        onChanged();
      } else {
        localIdentityBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *

     * The local identity used in the handshake.
     *

     *
     * .grpc.gcp.Identity local_identity = 5;
     */
    public Builder clearLocalIdentity() {
      if (localIdentityBuilder_ == null) {
        localIdentity_ = null;
        onChanged();
      } else {
        localIdentity_ = null;
        localIdentityBuilder_ = null;
      }

      return this;
    }
    /**
     *

     * The local identity used in the handshake.
     *

     *
     * .grpc.gcp.Identity local_identity = 5;
     */
    public io.grpc.alts.internal.Identity.Builder getLocalIdentityBuilder() {

      onChanged();
      return getLocalIdentityFieldBuilder().getBuilder();
    }
    /**
     *

     * The local identity used in the handshake.
     *

     *
     * .grpc.gcp.Identity local_identity = 5;
     */
    public io.grpc.alts.internal.IdentityOrBuilder getLocalIdentityOrBuilder() {
      if (localIdentityBuilder_ != null) {
        return localIdentityBuilder_.getMessageOrBuilder();
      } else {
        return localIdentity_ == null ?
            io.grpc.alts.internal.Identity.getDefaultInstance() : localIdentity_;
      }
    }
    /**
     *

     * The local identity used in the handshake.
     *

     *
     * .grpc.gcp.Identity local_identity = 5;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        io.grpc.alts.internal.Identity, io.grpc.alts.internal.Identity.Builder, io.grpc.alts.internal.IdentityOrBuilder>
        getLocalIdentityFieldBuilder() {
      if (localIdentityBuilder_ == null) {
        localIdentityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            io.grpc.alts.internal.Identity, io.grpc.alts.internal.Identity.Builder, io.grpc.alts.internal.IdentityOrBuilder>(
                getLocalIdentity(),
                getParentForChildren(),
                isClean());
        localIdentity_ = null;
      }
      return localIdentityBuilder_;
    }

    private boolean keepChannelOpen_ ;
    /**
     *

     * Indicate whether the handshaker service client should keep the channel
     * between the handshaker service open, e.g., in order to handle
     * post-handshake messages in the future.
     *

     *
     * bool keep_channel_open = 6;
     */
    public boolean getKeepChannelOpen() {
      return keepChannelOpen_;
    }
    /**
     *

     * Indicate whether the handshaker service client should keep the channel
     * between the handshaker service open, e.g., in order to handle
     * post-handshake messages in the future.
     *

     *
     * bool keep_channel_open = 6;
     */
    public Builder setKeepChannelOpen(boolean value) {

      keepChannelOpen_ = value;
      onChanged();
      return this;
    }
    /**
     *

     * Indicate whether the handshaker service client should keep the channel
     * between the handshaker service open, e.g., in order to handle
     * post-handshake messages in the future.
     *

     *
     * bool keep_channel_open = 6;
     */
    public Builder clearKeepChannelOpen() {

      keepChannelOpen_ = false;
      onChanged();
      return this;
    }

    private io.grpc.alts.internal.RpcProtocolVersions peerRpcVersions_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        io.grpc.alts.internal.RpcProtocolVersions, io.grpc.alts.internal.RpcProtocolVersions.Builder, io.grpc.alts.internal.RpcProtocolVersionsOrBuilder> peerRpcVersionsBuilder_;
    /**
     *

     * The RPC protocol versions supported by the peer.
     *

     *
     * .grpc.gcp.RpcProtocolVersions peer_rpc_versions = 7;
     */
    public boolean hasPeerRpcVersions() {
      return peerRpcVersionsBuilder_ != null || peerRpcVersions_ != null;
    }
    /**
     *

     * The RPC protocol versions supported by the peer.
     *

     *
     * .grpc.gcp.RpcProtocolVersions peer_rpc_versions = 7;
     */
    public io.grpc.alts.internal.RpcProtocolVersions getPeerRpcVersions() {
      if (peerRpcVersionsBuilder_ == null) {
        return peerRpcVersions_ == null ? io.grpc.alts.internal.RpcProtocolVersions.getDefaultInstance() : peerRpcVersions_;
      } else {
        return peerRpcVersionsBuilder_.getMessage();
      }
    }
    /**
     *

     * The RPC protocol versions supported by the peer.
     *

     *
     * .grpc.gcp.RpcProtocolVersions peer_rpc_versions = 7;
     */
    public Builder setPeerRpcVersions(io.grpc.alts.internal.RpcProtocolVersions value) {
      if (peerRpcVersionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        peerRpcVersions_ = value;
        onChanged();
      } else {
        peerRpcVersionsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *

     * The RPC protocol versions supported by the peer.
     *

     *
     * .grpc.gcp.RpcProtocolVersions peer_rpc_versions = 7;
     */
    public Builder setPeerRpcVersions(
        io.grpc.alts.internal.RpcProtocolVersions.Builder builderForValue) {
      if (peerRpcVersionsBuilder_ == null) {
        peerRpcVersions_ = builderForValue.build();
        onChanged();
      } else {
        peerRpcVersionsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *

     * The RPC protocol versions supported by the peer.
     *

     *
     * .grpc.gcp.RpcProtocolVersions peer_rpc_versions = 7;
     */
    public Builder mergePeerRpcVersions(io.grpc.alts.internal.RpcProtocolVersions value) {
      if (peerRpcVersionsBuilder_ == null) {
        if (peerRpcVersions_ != null) {
          peerRpcVersions_ =
            io.grpc.alts.internal.RpcProtocolVersions.newBuilder(peerRpcVersions_).mergeFrom(value).buildPartial();
        } else {
          peerRpcVersions_ = value;
        }
        onChanged();
      } else {
        peerRpcVersionsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *

     * The RPC protocol versions supported by the peer.
     *

     *
     * .grpc.gcp.RpcProtocolVersions peer_rpc_versions = 7;
     */
    public Builder clearPeerRpcVersions() {
      if (peerRpcVersionsBuilder_ == null) {
        peerRpcVersions_ = null;
        onChanged();
      } else {
        peerRpcVersions_ = null;
        peerRpcVersionsBuilder_ = null;
      }

      return this;
    }
    /**
     *

     * The RPC protocol versions supported by the peer.
     *

     *
     * .grpc.gcp.RpcProtocolVersions peer_rpc_versions = 7;
     */
    public io.grpc.alts.internal.RpcProtocolVersions.Builder getPeerRpcVersionsBuilder() {

      onChanged();
      return getPeerRpcVersionsFieldBuilder().getBuilder();
    }
    /**
     *

     * The RPC protocol versions supported by the peer.
     *

     *
     * .grpc.gcp.RpcProtocolVersions peer_rpc_versions = 7;
     */
    public io.grpc.alts.internal.RpcProtocolVersionsOrBuilder getPeerRpcVersionsOrBuilder() {
      if (peerRpcVersionsBuilder_ != null) {
        return peerRpcVersionsBuilder_.getMessageOrBuilder();
      } else {
        return peerRpcVersions_ == null ?
            io.grpc.alts.internal.RpcProtocolVersions.getDefaultInstance() : peerRpcVersions_;
      }
    }
    /**
     *

     * The RPC protocol versions supported by the peer.
     *

     *
     * .grpc.gcp.RpcProtocolVersions peer_rpc_versions = 7;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        io.grpc.alts.internal.RpcProtocolVersions, io.grpc.alts.internal.RpcProtocolVersions.Builder, io.grpc.alts.internal.RpcProtocolVersionsOrBuilder>
        getPeerRpcVersionsFieldBuilder() {
      if (peerRpcVersionsBuilder_ == null) {
        peerRpcVersionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            io.grpc.alts.internal.RpcProtocolVersions, io.grpc.alts.internal.RpcProtocolVersions.Builder, io.grpc.alts.internal.RpcProtocolVersionsOrBuilder>(
                getPeerRpcVersions(),
                getParentForChildren(),
                isClean());
        peerRpcVersions_ = null;
      }
      return peerRpcVersionsBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:grpc.gcp.HandshakerResult)
  }

  // @@protoc_insertion_point(class_scope:grpc.gcp.HandshakerResult)
  private static final io.grpc.alts.internal.HandshakerResult DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new io.grpc.alts.internal.HandshakerResult();
  }

  public static io.grpc.alts.internal.HandshakerResult getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<HandshakerResult>
      PARSER = new com.google.protobuf.AbstractParser<HandshakerResult>() {
    public HandshakerResult parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new HandshakerResult(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<HandshakerResult> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<HandshakerResult> getParserForType() {
    return PARSER;
  }

  public io.grpc.alts.internal.HandshakerResult getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct template non_coherent_weighted_tail_mean_impl</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../../accumulators/reference.html#header.boost.accumulators.statistics_fwd_hpp" title="Header <boost/accumulators/statistics_fwd.hpp>">
<link rel="prev" href="weighted_sum_kahan_impl.html" title="Struct template weighted_sum_kahan_impl">
<link rel="next" href="weighted_idm45443627929600.html" title="Struct template weighted_tail_quantile_impl">

Home
Libraries
People
FAQ
More

Struct template non_coherent_weighted_tail_mean_impl

boost::accumulators::impl::non_coherent_weighted_tail_mean_impl — Estimation of the (non-coherent) weighted tail mean based on order statistics (for both left and right tails)

Synopsis

// In header: <boost/accumulators/statistics_fwd.hpp>

template<typename Sample, typename Weight, typename LeftRight>
struct non_coherent_weighted_tail_mean_impl : public accumulator_base {
  // construct/copy/destruct
  non_coherent_weighted_tail_mean_impl(dont_care);

  // public member functions
  template<typename Args> result_type result(Args const &) const;
};

Description

An estimation of the non-coherent, weighted tail mean  is given by the weighted mean of the

Equation 1.38.

smallest samples (left tail) or the weighted mean of the

Equation 1.39.

largest samples (right tail) above a quantile  of level ,  being the total number of sample and  the sum of all  weights:

Equation 1.40.

Equation 1.41.

non_coherent_weighted_tail_mean_impl
        public
       construct/copy/destruct

non_coherent_weighted_tail_mean_impl(dont_care);

non_coherent_weighted_tail_mean_impl public member functions

template<typename Args> result_type result(Args const & args) const;

Copyright © 2005, 2006 Eric Niebler

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

redpajama_set_name: RedPajamaGithub


text:
'use strict';

var element = require('./element');

module.exports = function(className, attr) {
    return function(node) {
        var el = element(className);
        el.innerHTML = node.getAttribute(attr || 'msgout');
        return el;
    };
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>io.springside</groupId>
		<artifactId>springside-parent</artifactId>
		<version>4.3.0-SNAPSHOT</version>
		<relativePath>../modules/parent/</relativePath>
	</parent>
	<groupId>io.springside.examples</groupId>
	<artifactId>springside-examples</artifactId>
	<name>Springside :: Example</name>
	<packaging>pom</packaging>

	<modules>
		<module>quickstart</module>
		<module>showcase</module>
		<!--
		<module>boot-service</module>
		<module>boot-more</module>-->
	</modules>
</project>


text:
<?php

namespace Mmi\Session;

/**
 * Klasa wyjątku sesji
 */
class SessionException extends \Mmi\App\KernelException
{
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#nullable disable

using System.Collections.Generic;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion
{
    internal class BraceCompletionMetadata
    {
        public IEnumerable<char> OpeningBraces { get; }
        public IEnumerable<char> ClosingBraces { get; }
        public IEnumerable<string> ContentTypes { get; }

        public BraceCompletionMetadata(IReadOnlyDictionary<string, object> data)
        {
            OpeningBraces = data.GetEnumerableMetadata<char>(nameof(OpeningBraces));
            ClosingBraces = data.GetEnumerableMetadata<char>(nameof(ClosingBraces));
            ContentTypes = data.GetEnumerableMetadata<string>(nameof(ContentTypes));
        }
    }
}


text:
<?php

namespace app\modules\tasks;

use yii\base\Application;
use yii\base\BootstrapInterface;
use Yii;

class Bootstrap implements BootstrapInterface
{
    /**
     * @inheritdoc
     */
    public function bootstrap($app)
    {
        $this->registerDefinitions($app);
    }

    /**
     * Registers a class definitions in container.
     *
     * @param Application $app the application currently running
     */
    public function registerDefinitions($app)
    {
        Yii::$container->set('app\modules\tasks\components\TasksDispatcherInterface', function () use ($app) {
            return $app->get('tasksDispatcher');
        });
    }
}


text:
ALTER TABLE _auth_provider_oauth DROP CONSTRAINT _auth_provider_oauth_provider_user_id;

ALTER TABLE _auth_provider_oauth DROP COLUMN provider_keys;

ALTER TABLE _auth_provider_oauth RENAME COLUMN provider_type to oauth_provider;

ALTER TABLE _auth_provider_oauth ADD CONSTRAINT _auth_provider_oauth_provider_user_id UNIQUE (oauth_provider, provider_user_id);


text:
import services from '../../services'

export default function authorize(req, res, next) {
	let { username, password } = req.login
	services.userService.authenticate(username, password).then((result => {
		let { authenticated } = result
		if (authenticated) {
			req.login.authenticated = true
			next()
		} else {
			res.status(403).send({message: 'User did not authenticate'})
		}
	})).catch((error) => {
	res.json({
	  success: false,
	  message: `An error occurred: '${error}'`})
	})
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Text Widget Overview</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.0">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="TextWidgetObjects.html" title="Multiline Text Editor">
<link rel="prev" href="TextWidgetObjects.html" title="Multiline Text Editor">
<link rel="next" href="GtkTextIter.html" title="GtkTextIter">
<meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">

GTK+ 3 Reference Manual

Text Widget Overview

Text Widget Overview — Overview of GtkTextBuffer, GtkTextView, and friends

Conceptual Overview

GTK+ has an extremely powerful framework for multiline text editing.  The
primary objects involved in the process are GtkTextBuffer, which represents the
text being edited, and GtkTextView, a widget which can display a GtkTextBuffer.
Each buffer can be displayed by any number of views.

One of the important things to remember about text in GTK+ is that it's in the
UTF-8 encoding. This means that one character can be encoded as multiple
bytes. Character counts are usually referred to as
offsets, while byte counts are called
indexes. If you confuse these two, things will work fine
with ASCII, but as soon as your buffer contains multibyte characters, bad
things will happen.

Text in a buffer can be marked with tags. A tag is an
attribute that can be applied to some range of text. For example, a tag might
be called "bold" and make the text inside the tag bold. However, the tag
concept is more general than that; tags don't have to affect appearance. They
can instead affect the behavior of mouse and key presses, "lock" a range of
text so the user can't edit it, or countless other things. A tag is
represented by a GtkTextTag object. One GtkTextTag can be applied to any
number of text ranges in any number of buffers.

Each tag is stored in a GtkTextTagTable. A tag table defines a set of
tags that can be used together. Each buffer has one tag table associated with
it; only tags from that tag table can be used with the buffer. A single tag
table can be shared between multiple buffers, however.

Tags can have names, which is convenient sometimes (for example, you can name
your tag that makes things bold "bold"), but they can also be anonymous (which
is convenient if you're creating tags on-the-fly).

Most text manipulation is accomplished with iterators,
represented by a GtkTextIter. An iterator represents a position between two
characters in the text buffer. GtkTextIter is a struct designed to be
allocated on the stack; it's guaranteed to be copiable by value and never
contain any heap-allocated data. Iterators are not valid indefinitely;
whenever the buffer is modified in a way that affects the number of characters
in the buffer, all outstanding iterators become invalid. (Note that deleting
5 characters and then reinserting 5 still invalidates iterators, though you
end up with the same number of characters you pass through a state with a
different number).

Because of this, iterators can't be used to preserve positions across buffer
modifications. To preserve a position, the GtkTextMark object is ideal. You
can think of a mark as an invisible cursor or insertion point; it floats in
the buffer, saving a position. If the text surrounding the mark is deleted,
the mark remains in the position the text once occupied; if text is inserted
at the mark, the mark ends up either to the left or to the right of the new
text, depending on its gravity. The standard text
cursor in left-to-right languages is a mark with right gravity, because it
stays to the right of inserted text.

Like tags, marks can be either named or anonymous. There are two marks built-in
to GtkTextBuffer; these are named "insert" and
"selection_bound" and refer to the insertion point and the
boundary of the selection which is not the insertion point, respectively. If
no text is selected, these two marks will be in the same position. You can
manipulate what is selected and where the cursor appears by moving these
marks around.
[2]

Text buffers always contain at least one line, but may be empty (that
is, buffers can contain zero characters). The last line in the text
buffer never ends in a line separator (such as newline); the other
lines in the buffer always end in a line separator. Line separators
count as characters when computing character counts and character
offsets. Note that some Unicode line separators are represented with
multiple bytes in UTF-8, and the two-character sequence "\r\n" is also
considered a line separator.

Simple Example

The simplest usage of GtkTextView  might look like this:

1
2
3
4
5
6
7
8
9
10
11
12
13

GtkWidget *view;
GtkTextBuffer *buffer;

view = gtk_text_view_new ();

buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));

gtk_text_buffer_set_text (buffer, "Hello, this is some text", -1);

/* Now you might put the view in a container and display it on the
 * screen; when the user edits the text, signals on the buffer
 * will be emitted, such as "changed", "insert_text", and so on.
 */

In many cases it's also convenient to first create the buffer with
gtk_text_buffer_new(), then create a widget for that buffer with
gtk_text_view_new_with_buffer(). Or you can change the buffer the widget
displays after the widget is created with gtk_text_view_set_buffer().

Example of Changing Text Attributes

There are two ways to affect text attributes in GtkTextView.
You can change the default attributes for a given GtkTextView, and you can
apply tags that change the attributes for a region of text.  For text features
that come from the theme — such as font and foreground color — use
standard GtkWidget functions such as gtk_widget_modify_font() or
gtk_widget_override_text(). For other attributes there are dedicated methods on
GtkTextView such as gtk_text_view_set_tabs().

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

GtkWidget *view;
GtkTextBuffer *buffer;
GtkTextIter start, end;
PangoFontDescription *font_desc;
GdkRGBA rgba;
GtkTextTag *tag;

view = gtk_text_view_new ();

buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));

gtk_text_buffer_set_text (buffer, "Hello, this is some text", -1);

/* Change default font throughout the widget */
font_desc = pango_font_description_from_string ("Serif 15");
gtk_widget_modify_font (view, font_desc);
pango_font_description_free (font_desc);

/* Change default color throughout the widget */
gdk_rgba_parse ("green", &rgba);
gtk_widget_override_color (view, GTK_STATE_FLAG_NORMAL, &rgba);

/* Change left margin throughout the widget */
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 30);

/* Use a tag to change the color for just one part of the widget */
tag = gtk_text_buffer_create_tag (buffer, "blue_foreground",
                        "foreground", "blue", NULL);
gtk_text_buffer_get_iter_at_offset (buffer, &start, 7);
gtk_text_buffer_get_iter_at_offset (buffer, &end, 12);
gtk_text_buffer_apply_tag (buffer, tag, &start, &end);

The gtk-demo application that comes with
GTK+ contains more example code for GtkTextView.

[2]
If you want to place the cursor in response to a user action, be sure to use
gtk_text_buffer_place_cursor(), which moves both at once without causing a
temporary selection (moving one then the other temporarily selects the range in
between the old and new positions).

          Generated by GTK-Doc V1.18.1


text:
var Parser = require('jade').Parser;

module.exports = function(layoutPath) {

  function CustomParser() {
    Parser.apply(this, arguments);
  }

  CustomParser.prototype.__proto__ = Parser.prototype;

  CustomParser.prototype.resolvePath = function(path, purpose) {

    if (path == 'raml2boot-layout') {
      return layoutPath;
    }

    return Parser.prototype.resolvePath.apply(this, arguments);
  };

  return CustomParser;
};


text:
<?php

namespace League\Event;

class BufferedEmitter extends Emitter
{
    /**
     * @var EventInterface[]
     */
    protected $bufferedEvents = [];

    /**
     * @inheritdoc
     */
    public function emit($event)
    {
        $this->bufferedEvents[] = $event;

        return $event;
    }

    /**
     * @inheritdoc
     */
    public function emitBatch(array $events)
    {
        foreach($events as $event) {
            $this->bufferedEvents[] = $event;
        }

        return $events;
    }

    /**
     * Emit the buffered events.
     *
     * @return array
     */
    public function emitBufferedEvents()
    {
        $result = [];

        foreach($this->bufferedEvents as $event) {
            $result[] = parent::emit($event);
        }

        return $result;
    }
}


text:
<?php

use Symfony\Component\Routing\RouteCollection;

$collection = new RouteCollection();
$collection->addCollection($loader->import("@DefaultTestBundle/Resources/config/routing.php"));

/** @var Symfony\Component\Routing\RouteCollection $nativeRoutes */
$nativeRoutes = $loader->import(
    "@FpJsFormValidatorBundle/Resources/config/routing.xml"
);
$nativeRoutes->addPrefix('/fp_js_form_validator');
$collection->addCollection($nativeRoutes);

return $collection;


text:
// Imports
const fs = require('fs');
const path = require('path');
const yaml = require('js-yaml');
const rmdir = require('rmdir-recursive').sync;
const xml2js = require('xml2js');
const xmlmapper = require('./josm-to-h2geo-mapper');

// Constants
const outputDir = 'out/';
const baseDir = 'presets/';

/**
 * Process yaml file and translate into JSON. Output in output/ directory.
 * @param f the input yaml file
 * @return {"name": {"en": "The Preset Name"}, "description": {"en": "Your preset description"}, "file": "preset_file.json"}
 */
var processXml = function (f) {
  // Convert Yaml to JSON
  var parser = new xml2js.Parser();
  parser.parseString(fs.readFileSync(baseDir + f), function (err, result) {
    if (err) {
      console.error("Error while parsing: " + err);
      throw err;
    }
    var xmlConverted = result;
    if (!xmlConverted.presets.$.shortdescription || !xmlConverted.presets.$.description) {
      console.error("Error in structure");
      console.log(result);
      throw "Invalid Yaml Structure for file " + f;
    }
    var parsed = xmlmapper(xmlConverted);
    var filename = path.basename(f, path.extname(f)) + '.json';
    fs.writeFileSync(outputDir + filename, JSON.stringify(parsed));
    console.log(parsed);
    return {"name": parsed.name, "description": parsed.description, "file": filename, "version": parsed.version};
  });

};

/**
 * Process json file. Output in output/ directory.
 * @param f the input json file
 * @return {"name": {"en": "The Preset Name"}, "description": {"en": "Your preset description"}, "file": "preset_file.json"}
 */
var processJson = function (f) {
  var parsed = JSON.parse(fs.readFileSync(baseDir + f));
  if (!parsed.name) {
    throw "Invalid JSON Structure for file " + f;
  }
  var filename = path.basename(f);
  var filenameYml = path.basename(f, path.extname(f)) + '.yml';

  // Write to output directory
  fs.writeFileSync(outputDir + filename, JSON.stringify(parsed));

  // Convert JSON to Yaml
  fs.writeFileSync(baseDir + filenameYml, yaml.safeDump(parsed));
  // Remove Old JSON File
  fs.unlinkSync(baseDir + filename);
  return {"name": parsed.name, "description": parsed.description, "file": filename};
};

/**
 * Main processing function factory
 * @param presets the presets object
 * @returns {Function} the function which will process all files
 */
var getFileProcessor = function(presets) {
  return function (f) {

    try {
      // Only process files
      var s = fs.statSync(baseDir + f);
      if (!s.isFile()) {
        return;
      }

      var ext = path.extname(f);
      var basename = path.basename(f);

      var p;
      // Process yaml or json files
      switch (ext) {
        case '.xml':
          p = processXml(f);
          presets[p.file] = p;
          break;
        case '.json':
          p = processJson(f);
          presets[p.file] = p;
          break;
      }
    } catch (err) {
      console.error(err);
    }
  }
};

var exec = function() {
  // Create output directory
  if (!fs.existsSync(outputDir)) {
    fs.mkdirSync(outputDir);
  }

  var dir = fs.readdirSync(baseDir);
  var output = {
    revision: process.argv[2],
    lastUpdate: new Date().toISOString(),
    presets: {}
  };

  /**
   * Parse directory
   */
  dir.forEach(getFileProcessor(output.presets));

  fs.writeFileSync(outputDir + 'presets.json', JSON.stringify(output));

};

// Execute code
exec();


text:
script_location=$(dirname $(readlink --canonicalize $0))
. ${script_location}/common_setup.sh

echo "enabling epel yum repository..."
install_from_repo epel-release

# install CernVM-FS RPM packages
echo "installing RPM packages... "
install_rpm "$CONFIG_PACKAGES"
install_rpm $CLIENT_PACKAGE
install_rpm $UNITTEST_PACKAGE
install_rpm $FUSE3_PACKAGE
install_rpm $SHRINKWRAP_PACKAGE

# setup environment
echo -n "setting up CernVM-FS environment..."
sudo cvmfs_config setup                          || die "fail (cvmfs_config setup)"
sudo mkdir -p /var/log/cvmfs-test                || die "fail (mkdir /var/log/cvmfs-test)"
sudo chown sftnight:sftnight /var/log/cvmfs-test || die "fail (chown /var/log/cvmfs-test)"
sudo systemctl start autofs                      || die "fail (systemctl start autofs)"
sudo cvmfs_config chksetup > /dev/null           || die "fail (cvmfs_config chksetup)"
echo "done"

# install additional stuff (needed for perl testing tools)
echo "installing additional RPM packages..."
install_from_repo gcc
install_from_repo gcc-c++
install_from_repo wget

install_from_repo python2

# For 006 kernel compile
install_from_repo openssl-devel

# traffic shaping
# install_from_repo trickle
# TODO: uncomment once trickle is available for Centos 8
#       and enable test 056-lowspeedlimit

# Migration test needs lsb_release
echo "install lsb_release..."
install_from_repo redhat-lsb-core

# increase open file descriptor limits
echo -n "increasing ulimit -n ... "
set_nofile_limit 65536 || die "fail"
echo "done"


text:
<?php

namespace Jazzyweb\doDocBundle\Services;

use Symfony\Component\Yaml\Yaml;

/**
 * Resolves book configuration by merging all the different configuration
 * sources (CLI command options, YAML configuration file and default values).
 */
class EasyBookConfigurator
{
    private $app;

    public function __construct($app)
    {
        $this->app = $app;
    }

    /**
     * Resolves book configuration options by parsing their values as Twig strings.
     * easybook allows to use Twig expressions as the value of options. For example:
     * { "book": { "title": "{{ book.author }} diary", "author": "...", ... } }
     */
    public function resolveConfiguration()
    {
        $config = $this->app->get('book');

        // prepare options needed to parse option values as Twig expressions
        $theApp = clone $this->app;
        $twigOptions = array(
            'book'    => $config,
            'edition' => $config['editions'][$this->app->get('publishing.edition')]
        );

        array_walk_recursive($config, function (&$value, $key) use ($theApp, $twigOptions) {
            // this condition is needed to prevent the conversion performed by
            // Twig to some special values: true => 1, false => 0, null => (nothing)
            if (true !== $value && false !== $value && null !== $value) {
                $value = $theApp->renderString($value, $twigOptions);
            }
        });

        // load final book configuration into application
        $this->app->set('book', $config);

        // perform the last global validation
        $this->app->get('validator')->validateResolvedConfiguration();
    }

    /**
     * Loads book configuration from three different sources:
     *   1. '--configuration' option from 'publish' command
     *   2. config.yml configuration file
     *   3. easybook default options
     *
     * In addition, it validates the loaded options.
     */
    public function loadBookConfiguration()
    {
        $bookDir = $this->app->get('publishing.dir.book');
        $slug    = $this->app->get('publishing.book.slug');

        // 1. load options from 'config.yml' file
        $configFile = $bookDir.'/config.yml';
        if (!file_exists($configFile)) {
            throw new \RuntimeException(sprintf(
                "There is no 'config.yml' configuration file for '%s' book \n\n"
                ."Try to create the book again with the 'new' command or create \n"
                ."'%s' file by hand",
                $slug, realpath($bookDir).'/config.yml'
            ));
        }
        $fileConfig = Yaml::parse($configFile);

        // 2. load easybook default options for books
        $defaultConfig = $this->app->get('app.book.defaults');

        // TODO: use OptionsResolver component when it supports recursive merging
        // and allows to set options different from defaultValues.
        // $resolver = new \Symfony\Component\OptionsResolver\OptionsResolver();
        // easybook allows authors to define any configuration option under
        // 'book' key in 'config.yml' file. However, resolver will throw an
        // exception if there are options different from the default options.
        // The trick is to use 'setOptional()' method to set all book options
        // as optional. The author can then define as many options as needed.
        // $resolver->setOptional(array_keys($fileConfig['book'] ?: array()));
        // $config = $resolver->setDefaults($defaultConfig)->resolve($fileConfig['book'] ?: array());
        // $resolver->setOptional(array_keys($commandConfig['book'] ?: array()));
        // $config = $resolver->setDefaults($config)->resolve($commandConfig['book'] ?: array());

        // merge and resolve configuration options
        $config = array_replace_recursive(
            $defaultConfig,
            $fileConfig['book'] ?: array()
        );

        // validate book configuration
        $this->app->get('validator')->validateBookConfig($config);

        // load book configuration into the application
        $this->app->set('book', $config);
    }

    /**
     * Loads edition configuration taking into account edition inheritance
     * and easybook default options for editions. Options set by
     * '--configuration' are already merged by 'loadBookConfiguration()' method.
     *
     * In addition, it validates the loaded options.
     */
    public function loadEditionConfiguration()
    {
        $book    = $this->app->get('book');

        $edition = $this->app->get('publishing.edition');

        // 1. load current edition configuration
        $editionConfig = $book['editions'][$edition] ?: array();

        // 2. resolve edition inheritance
        $parentConfig = array();
        if (null != $parent = $this->app->edition('extends')) {
            if (!array_key_exists($parent, $book['editions'])) {
                throw new \UnexpectedValueException(sprintf(
                    " ERROR: '%s' edition extends nonexistent '%s' edition"
                    ."\n\n"
                    ."Check in '%s' file \n"
                    ."that the value of 'extends' option in '%s' edition is a valid \n"
                    ."edition of the book",
                    $edition, $parent, realpath($this->app->get('publishing.dir.book').'/config.yml'), $edition
                ));
            }

            $parentConfig = $book['editions'][$parent] ?: array();
        }

        // 3. load easybook default options for editions
        $defaultConfig = $this->app->get('app.edition.defaults');

        // TODO: use OptionsResolver component when it supports recursive merging
        // and allows to set options different from defaultValues.
        // $resolver = new \Symfony\Component\OptionsResolver\OptionsResolver();
        // easybook allows authors to define any configuration option under
        // 'edition' key in 'config.yml' file. However, resolver will throw an
        // exception if there are options different from the default options.
        // The trick is to use 'setOptional()' method to set all edition options
        // as optional. The author can then define as many options as needed.
        // $resolver->setOptional(array_keys($parentConfig ?: array()));
        // $config = $resolver->setDefaults($defaultConfig)->resolve($parentConfig ?: array());
        // $resolver->setOptional(array_keys($config ?: array()));
        // $config = $resolver->setDefaults($config)->resolve($editionConfig ?: array());

        // merge and resolve configuration options
        $config = array_replace_recursive(
            $defaultConfig,
            $parentConfig,
            $editionConfig
        );

        // validate edition configuration
        $this->app->get('validator')->validateEditionConfig($config);

        // load resolved edition configuration into the application
        $book['editions'][$edition] = $config;
        $this->app->set('book', $book);
    }
}


text:
<?php
/**
 * The default template for displaying content
 *
 * Used for both single and index/archive/search.
 *
 * @package idealabstarter
 * @since idealabstarter 1.0.0
 */

?>

<div id="post-<?php the_ID(); ?>" <?php post_class('post-entry shim-top-sml'); ?>>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

		<?php idealabstarter_entry_meta(); ?>

		<?php the_content( __( 'Read More...', 'idealabstarter' ) ); ?>


text:
ColourPickerPalate = _.flatten(colourTableLayout);
ColourPickerPalatePrimary = _.where(ColourPickerPalate, {
  primary: true
});


text:
<!DOCTYPE html>

		<meta charset="utf-8" />
		<base href="../../../" />

		<link type="text/css" rel="stylesheet" href="page.css" />

[name]

			A two dimensional surface that extends infinitely in 3d space, represented in [link:http://mathworld.wolfram.com/HessianNormalForm.html Hessian normal form]
			by a unit length normal vector and a constant.

Constructor

[name]( [param:Vector3 normal], [param:Float constant] )

		[page:Vector3 normal] - (optional) a unit length [page:Vector3] defining the normal of the plane. Default is *(1, 0, 0)*.

		[page:Float constant] - (optional) the signed distance from the origin to the plane. Default is `0`.

Properties

[property:Boolean isPlane]

			Read-only flag to check if a given object is of type [name].

[property:Vector3 normal]

[property:Float constant]

Methods

[method:this applyMatrix4]( [param:Matrix4 matrix], [param:Matrix3 optionalNormalMatrix] )

		[page:Matrix4 matrix] - the [Page:Matrix4] to apply.

		[page:Matrix3 optionalNormalMatrix] - (optional) pre-computed normal [Page:Matrix3] of the Matrix4 being applied.

		Apply a Matrix4 to the plane. The matrix must be an affine, homogeneous transform.

		If supplying an [page:Matrix3 optionalNormalMatrix], it can be created like so:

		const optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );

[method:Plane clone]()

Returns a new plane with the same [page:.normal normal] and [page:.constant constant] as this one.

[method:Vector3 coplanarPoint]( [param:Vector3 target] )

		[page:Vector3 target] — the result will be copied into this Vector3.

		Returns a [page:Vector3] coplanar to the plane, by calculating the projection of the
		normal vector at the origin onto the plane.

[method:this copy]( [param:Plane plane] )

		Copies the values of the passed plane's [page:.normal normal] and [page:.constant constant]
		properties to this plane.

[method:Float distanceToPoint]( [param:Vector3 point] )

Returns the signed distance from the [page:Vector3 point] to the plane.

[method:Float distanceToSphere]( [param:Sphere sphere] )

Returns the signed distance from the [page:Sphere sphere] to the plane.

[method:Boolean equals]( [param:Plane plane] )

			Checks to see if two planes are equal (their [page:.normal normal] and
			[page:.constant constant] properties match).

[method:Vector3 intersectLine]( [param:Line3 line], [param:Vector3 target] )

		[page:Line3 line] - the [page:Line3] to check for intersection.

		[page:Vector3 target] — the result will be copied into this Vector3.

		Returns the intersection point of the passed line and the plane. Returns null
		 if the line does not intersect. Returns the line's starting point if the line is
		 coplanar with the plane.

[method:Boolean intersectsBox]( [param:Box3 box] )

		[page:Box3 box] - the [page:Box3] to check for intersection.

		Determines whether or not this plane intersects [page:Box3 box].

[method:Boolean intersectsLine]( [param:Line3 line] )

		[page:Line3 line] - the [page:Line3] to check for intersection.

		Tests whether a line segment intersects with (passes through) the plane.

[method:Boolean intersectsSphere]( [param:Sphere sphere] )

		[page:Sphere sphere]  - the [page:Sphere] to check for intersection.

		Determines whether or not this plane intersects [page:Sphere sphere].

[method:this negate]()

		Negates both the normal vector and the constant.

[method:this normalize]()

			Normalizes the [page:.normal normal] vector, and adjusts the [page:.constant constant]
			value accordingly.

[method:Vector3 projectPoint]( [param:Vector3 point], [param:Vector3 target] )

		[page:Vector3 point] - the [page:Vector3] to project onto the plane.

		[page:Vector3 target] — the result will be copied into this Vector3.

		Projects a [page:Vector3 point] onto the plane.

[method:this set]( [param:Vector3 normal], [param:Float constant] )

			[page:Vector3 normal] - a unit length [page:Vector3] defining the normal of the plane.

			[page:Float constant] - the signed distance from the origin to the plane. Default is `0`.

			Sets this plane's [page:.normal normal] and [page:.constant constant] properties by copying the values from the given normal.

[method:this setComponents]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] )

		[page:Float x] - x value of the unit length normal vector.

		[page:Float y] - y value of the unit length normal vector.

		[page:Float z] - z value of the unit length normal vector.

		[page:Float w] - the value of the plane's [page:.constant constant] property.

		Set the individual components that define the plane.

[method:this setFromCoplanarPoints]( [param:Vector3 a], [param:Vector3 b], [param:Vector3 c] )

		 [page:Vector3 a] - first point on the plane.

		 [page:Vector3 b] - second point on the plane.

		 [page:Vector3 c] - third point on the plane.

		Defines the plane based on the 3 provided points. The winding order is assumed to be counter-clockwise,
		and determines the direction of the [page:.normal normal].

[method:this setFromNormalAndCoplanarPoint]( [param:Vector3 normal], [param:Vector3 point] )

		[page:Vector3 normal] - a unit length [page:Vector3] defining the normal of the plane.

		[page:Vector3 point] - [page:Vector3]

		Sets the plane's properties as defined by a [page:Vector3 normal] and an arbitrary coplanar [page:Vector3 point].

[method:this translate]( [param:Vector3 offset] )

		[page:Vector3 offset] - the amount to move the plane by.

		Translates the plane by the distance defined by the [page:Vector3 offset] vector.
		Note that this only affects the plane constant and will not affect the normal vector.

Source

			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]


text:
namespace views {

class MenuModelAdapter;

namespace internal {

class MenuRunnerImpl;

// Given a MenuModel, adapts MenuRunnerImpl which expects a MenuItemView.
class VIEWS_EXPORT MenuRunnerImplAdapter
    : public NON_EXPORTED_BASE(MenuRunnerImplInterface) {
 public:
  MenuRunnerImplAdapter(ui::MenuModel* menu_model,
                        const base::Closure& on_menu_closed_callback);

  // MenuRunnerImplInterface:
  bool IsRunning() const override;
  void Release() override;
  MenuRunner::RunResult RunMenuAt(Widget* parent,
                                  MenuButton* button,
                                  const gfx::Rect& bounds,
                                  MenuAnchorPosition anchor,
                                  int32_t types) override;
  void Cancel() override;
  base::TimeTicks GetClosingEventTime() const override;

 private:
  ~MenuRunnerImplAdapter() override;

  std::unique_ptr<MenuModelAdapter> menu_model_adapter_;
  MenuRunnerImpl* impl_;

  DISALLOW_COPY_AND_ASSIGN(MenuRunnerImplAdapter);
};

}  // namespace internal
}  // namespace views

#endif  // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_


text:
"""Common settings for all environments."""

# ----------------------------------------------------------------------------
# Imports:
# ----------------------------------------------------------------------------
from os.path import abspath, basename, dirname, join, normpath
import errno
import os
import sys
from django.utils.crypto import get_random_string
from django.core.urlresolvers import reverse_lazy

# ----------------------------------------------------------------------------
# Settings:
# ----------------------------------------------------------------------------

# ---- path configuration

DPA_ROOT = dirname(dirname(abspath(__file__)))
SITE_NAME = basename(DPA_ROOT)
SITE_ROOT = dirname(DPA_ROOT)
SECRET_FILE = normpath(join(SITE_ROOT, 'deploy', 'SECRET'))

# append so that imports work within the apps
sys.path.append(DPA_ROOT)

# ---- debug configuration

DEBUG = False
TEMPLATE_DEBUG = DEBUG

# ---- app configuration

INSTALLED_APPS = (
    'suit',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django_extensions',

    # ----
    '_site',
    'django_mptt_admin',
    'locations',
    'mptt',
    'products',
    'ptasks',
    'rest_framework',
    'rest_framework_swagger',
    'users',
)

# ---- template context processors

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.static",
    "django.core.context_processors.tz",
    "django.contrib.messages.context_processors.messages",
    'django.core.context_processors.request',
)

# ---- template directories

TEMPLATE_DIRS = (
    normpath(join(DPA_ROOT, 'templates/')),
    normpath(join(SITE_ROOT, 'products/templates/products')),
    normpath(join(SITE_ROOT, 'ptasks/templates/ptasks')),
)

# ---- middleware configuration

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

# ---- url configuration

LOGIN_URL = "/auth/login/"
LOGIN_REDIRECT_URL = "/"
LOGOUT_URL = "/auth/logout/"

ROOT_URLCONF = 'dpa.urls'

# ---- static file configuration

STATIC_URL = '/static/'
STATICFILES_DIRS = (
  normpath(join(SITE_ROOT, 'static/')),
)

# ---- general configuration

LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'EST'
USE_I18N = True
USE_L10N = True
USE_TZ = True
WSGI_APPLICATION = 'dpa.wsgi.application'

# ---- secret key configuration

# try to load the SECRET_KEY from our SECRET_FILE. If that fails, then generate
# a random SECRET_KEY and save it into our SECRET_FILE for future loading. If
# everything fails, then just raise an exception.
try:
    SECRET_KEY = open(SECRET_FILE).read().strip()
except IOError:
    try:
        try:
            os.makedirs(dirname(SECRET_FILE))
        except OSError as e:
            if e.errno != errno.EEXIST:
                raise
        chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
        SECRET_KEY = get_random_string(50, chars)
        with open(SECRET_FILE, 'w') as f:
            f.write(SECRET_KEY)
    except IOError:
        raise Exception('Cannot open file `%s` for writing.' % SECRET_FILE)


text:
@interface EXORpcUnmapRequest ()
@property(copy,nonatomic) NSString *alias;
@property(copy,nonatomic) EXORpcRequestComplete complete;
@end

@implementation EXORpcUnmapRequest

+ (EXORpcUnmapRequest *)unmapWithAlias:(NSString *)alias complete:(EXORpcRequestComplete)complete
{
    return [[EXORpcUnmapRequest alloc] initWithAlias:alias complete:complete];
}

- (instancetype)initWithAlias:(NSString *)alias complete:(EXORpcRequestComplete)complete
{
    if (self = [super init]) {
        _alias = [alias copy];
        _complete = [complete copy];
    }
    return self;
}

- (id)init
{
    return nil;
}

- (void)doResult:(NSDictionary *)result
{
    if (self.complete) {
        NSError *err = [self errorFromStatus:result];
        if (err) {
            self.complete(err);
        } else {
            self.complete(nil);
        }
    }
}

- (NSDictionary *)plistValue
{
    return @{ @"procedure": @"unmap", @"arguments": @[@"alias", self.alias]};
}

- (BOOL)isEqual:(id)object
{
    if (![object isKindOfClass:[self class]]) {
        return NO;
    }
    return [self.alias isEqual:[object alias]];
}

- (NSUInteger)hash
{
    return self.alias.hash;
}

- (id)copyWithZone:(NSZone *)zone
{
    return self;
}

@end


text:
"use strict";

const P = require('bluebird');
const HyperSwitch = require('hyperswitch');
const URI = HyperSwitch.URI;

const spec = HyperSwitch.utils.loadSpec(`${__dirname}/mobileapps.yaml`);

class MobileApps {
    constructor(options) {
        this._options = options || {};
        this._options.storage = this._options.storage || 'both';
    }

    _generateDoubleFetching(hyper, req, oldPath, newPath) {
        return P.join(
            hyper.get({
                uri: new URI(oldPath),
                headers: req.headers
            })
            .catch((e) => {
                hyper.log('error/mobileapps', {
                    message: 'Error fetching old mobile content',
                    error: e
                });
                throw e;
            }),
            hyper.get({
                uri: new URI(newPath),
                headers: req.headers
            })
            .catch((e) => {
                hyper.log('error/mobileapps', {
                    message: 'Error fetching new mobile content',
                    error: e
                });
            })
        )
        .then((results) => {
            const oldBucket = results[0];
            const newBucket = results[1];

            if (oldBucket && newBucket) {
                if (JSON.stringify(oldBucket.body) !== JSON.stringify(newBucket.body)) {
                    hyper.log('error/mobileapps', {
                        message: 'Content mismatch between old and new bucket',
                        old_etag: oldBucket.headers.etag,
                        new_etag: newBucket.headers.etag
                    });
                }
            }

            // TODO: Even more logging!
            return oldBucket || newBucket;
        });
    }

    getSections(hyper, req) {
        const rp = req.params;
        const oldPath = [rp.domain, 'sys', 'mobileapps_old', 'mobile-sections', rp.title];
        if (rp.revision) {
            oldPath.push(rp.revision);
        }
        const newPath = [rp.domain, 'sys', 'mobileapps_new', 'mobile-sections', rp.title];
        if (rp.revision) {
            newPath.push(rp.revision);
        }
        if (this._options.storage === 'new') {
            return hyper.get({
                uri: new URI(newPath),
                headers: req.headers
            });
        }
        if (this._options.storage === 'old') {
            return hyper.get({
                uri: new URI(oldPath),
                headers: req.headers
            });
        }
        return this._generateDoubleFetching(hyper, req, oldPath, newPath);
    }

    getPart(part, hyper, req) {
        const rp = req.params;
        const oldPath = [rp.domain, 'sys', 'mobileapps_old', `mobile-sections-${part}`, rp.title];
        if (rp.revision) {
            oldPath.push(rp.revision);
        }
        const newPath = [rp.domain, 'sys', 'mobileapps_new', `mobile-sections-${part}`, rp.title];
        if (rp.revision) {
            newPath.push(rp.revision);
        }
        if (this._options.storage === 'new') {
            return hyper.get({
                uri: new URI(newPath),
                headers: req.headers
            });
        }
        if (this._options.storage === 'old') {
            return hyper.get({
                uri: new URI(oldPath),
                headers: req.headers
            });
        }
        return this._generateDoubleFetching(hyper, req, oldPath, newPath);
    }
}

module.exports = (options) => {
    const mobileApps = new MobileApps(options);

    return {
        spec,
        operations: {
            getSections: mobileApps.getSections.bind(mobileApps),
            getSectionsLead: mobileApps.getPart.bind(mobileApps, 'lead'),
            getSectionsRemaining: mobileApps.getPart.bind(mobileApps, 'remaining')
        }
    };
};


text:
import os

class NotStagedError(Exception):
    pass

class AlreadyStagedError(Exception):
    pass

class AlreadyCommittedError(Exception):
    pass

def _get_committed_history_path(vcs):
    """Get the path to the file containing committed tests history

    Args:
        vcs (easyci.vcs.base.Vcs)

    Returns:
        str - the path
    """
    return os.path.join(vcs.private_dir(), 'passed')

def _get_staged_history_path(vcs):
    """Get the path to the file containing staged tests history

    Args:
        vcs (easyci.vcs.base.Vcs)

    Returns:
        str - the path
    """
    return os.path.join(vcs.private_dir(), 'in_progress')

def get_committed_signatures(vcs):
    """Get the list of committed signatures

    Args:
        vcs (easyci.vcs.base.Vcs)

    Returns:
        list(basestring) - list of signatures
    """
    committed_path = _get_committed_history_path(vcs)
    known_signatures = []
    if os.path.exists(committed_path):
        with open(committed_path, 'r') as f:
            known_signatures = f.read().split()
    return known_signatures

def get_staged_signatures(vcs):
    """Get the list of staged signatures

    Args:
        vcs (easyci.vcs.base.Vcs)

    Returns:
        list(basestring) - list of signatures
    """
    staged_path = _get_staged_history_path(vcs)
    known_signatures = []
    if os.path.exists(staged_path):
        with open(staged_path, 'r') as f:
            known_signatures = f.read().split()
    return known_signatures

def commit_signature(vcs, user_config, signature):
    """Add `signature` to the list of committed signatures

    The signature must already be staged

    Args:
        vcs (easyci.vcs.base.Vcs)
        user_config (dict)
        signature (basestring)

    Raises:
        NotStagedError
        AlreadyCommittedError
    """
    if signature not in get_staged_signatures(vcs):
        raise NotStagedError
    evidence_path = _get_committed_history_path(vcs)
    committed_signatures = get_committed_signatures(vcs)
    if signature in committed_signatures:
        raise AlreadyCommittedError
    committed_signatures.append(signature)
    string = '\n'.join(committed_signatures[-user_config['history_limit']:])
    with open(evidence_path, 'w') as f:
        f.write(string)
    unstage_signature(vcs, signature)

def stage_signature(vcs, signature):
    """Add `signature` to the list of staged signatures

    Args:
        vcs (easyci.vcs.base.Vcs)
        signature (basestring)

    Raises:
        AlreadyStagedError
    """
    evidence_path = _get_staged_history_path(vcs)
    staged = get_staged_signatures(vcs)
    if signature in staged:
        raise AlreadyStagedError
    staged.append(signature)
    string = '\n'.join(staged)
    with open(evidence_path, 'w') as f:
        f.write(string)

def unstage_signature(vcs, signature):
    """Remove `signature` from the list of staged signatures

    Args:
        vcs (easyci.vcs.base.Vcs)
        signature (basestring)

    Raises:
        NotStagedError
    """
    evidence_path = _get_staged_history_path(vcs)
    staged = get_staged_signatures(vcs)
    if signature not in staged:
        raise NotStagedError
    staged.remove(signature)
    string = '\n'.join(staged)
    with open(evidence_path, 'w') as f:
        f.write(string)

def clear_history(vcs):
    """Clear (committed) test run history from this project.

    Args:
        vcs (easyci.vcs.base.Vcs)
    """
    evidence_path = _get_committed_history_path(vcs)
    if os.path.exists(evidence_path):
        os.remove(evidence_path)


text:
package ru.karamoff.basketdemo.servlets;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import ru.karamoff.basketdemo.Helpers;
import ru.karamoff.basketdemo.models.Item;
import ru.karamoff.basketdemo.repositories.ItemRepository;
import ru.karamoff.basketdemo.repositories.ItemRepositoryImpl;
import ru.karamoff.basketdemo.services.ItemService;
import ru.karamoff.basketdemo.services.ItemServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

@WebServlet("/items")
public class ItemsServlet extends HttpServlet {

    private ItemService service;
    private final ObjectMapper mapper = new ObjectMapper();

    @Override
    public void init() {
        DriverManagerDataSource dataSource = Helpers.getDefaultDataSource();
        ItemRepository itemRepository = new ItemRepositoryImpl(dataSource);
        this.service = new ItemServiceImpl(itemRepository);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        req.setCharacterEncoding("UTF-8");
        resp.setCharacterEncoding("UTF-8");
        List<Item> items = service.getAllItems();
        String resultJson = mapper.writeValueAsString(items);
        resp.setStatus(200);
        resp.setContentType("application/json");
        PrintWriter writer = resp.getWriter();
        writer.write(resultJson);
    }
}


text:
"""Formatter for Windows Shortcut (LNK) files."""

from plaso.lib import errors
from plaso.formatters import interface

class WinLnkLinkFormatter(interface.ConditionalEventFormatter):
  """Formatter for a Windows Shortcut (LNK) link event."""

  DATA_TYPE = 'windows:lnk:link'

  FORMAT_STRING_PIECES = [
      u'[{description}]',
      u'File size: {file_size}',
      u'File attribute flags: 0x{file_attribute_flags:08x}',
      u'Drive type: {drive_type}',
      u'Drive serial number: 0x{drive_serial_number:08x}',
      u'Volume label: {volume_label}',
      u'Local path: {local_path}',
      u'Network path: {network_path}',
      u'cmd arguments: {command_line_arguments}',
      u'env location: {env_var_location}',
      u'Relative path: {relative_path}',
      u'Working dir: {working_directory}',
      u'Icon location: {icon_location}',
      u'Link target: [{link_target}]']

  FORMAT_STRING_SHORT_PIECES = [
      u'[{description}]',
      u'{linked_path}',
      u'{command_line_arguments}']

  SOURCE_LONG = 'Windows Shortcut'
  SOURCE_SHORT = 'LNK'

  def _GetLinkedPath(self, event_object):
    """Determines the linked path.

    Args:
      event_object: The event object (EventObject) containing the event
                    specific data.

    Returns:
      A string containing the linked path.
    """
    if hasattr(event_object, 'local_path'):
      return event_object.local_path

    if hasattr(event_object, 'network_path'):
      return event_object.network_path

    if hasattr(event_object, 'relative_path'):
      paths = []
      if hasattr(event_object, 'working_directory'):
        paths.append(event_object.working_directory)
      paths.append(event_object.relative_path)

      return u'\\'.join(paths)

    return 'Unknown'

  def GetMessages(self, event_object):
    """Returns a list of messages extracted from an event object.

    Args:
      event_object: The event object (EventObject) containing the event
                    specific data.

    Returns:
      A list that contains both the longer and shorter version of the message
      string.
    """
    if self.DATA_TYPE != event_object.data_type:
      raise errors.WrongFormatter(u'Unsupported data type: {0:s}.'.format(
          event_object.data_type))

    # Update event object with a description if necessary.
    if not hasattr(event_object, 'description'):
      event_object.description = u'Empty description'

    # Update event object with the linked path.
    event_object.linked_path = self._GetLinkedPath(event_object)

    return super(WinLnkLinkFormatter, self).GetMessages(event_object)