text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/videointelligence/v1beta1/video_intelligence.proto

package com.google.cloud.videointelligence.v1beta1;

/**
 *

 * Video annotation request.
 *

 *
 * Protobuf type {@code google.cloud.videointelligence.v1beta1.AnnotateVideoRequest}
 */
public  final class AnnotateVideoRequest extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1beta1.AnnotateVideoRequest)
    AnnotateVideoRequestOrBuilder {
  // Use AnnotateVideoRequest.newBuilder() to construct.
  private AnnotateVideoRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private AnnotateVideoRequest() {
    inputUri_ = "";
    inputContent_ = "";
    features_ = java.util.Collections.emptyList();
    outputUri_ = "";
    locationId_ = "";
  }

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

            inputUri_ = s;
            break;
          }
          case 16: {
            int rawValue = input.readEnum();
            if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
              features_ = new java.util.ArrayList<java.lang.Integer>();
              mutable_bitField0_ |= 0x00000004;
            }
            features_.add(rawValue);
            break;
          }
          case 18: {
            int length = input.readRawVarint32();
            int oldLimit = input.pushLimit(length);
            while(input.getBytesUntilLimit() > 0) {
              int rawValue = input.readEnum();
              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
                features_ = new java.util.ArrayList<java.lang.Integer>();
                mutable_bitField0_ |= 0x00000004;
              }
              features_.add(rawValue);
            }
            input.popLimit(oldLimit);
            break;
          }
          case 26: {
            com.google.cloud.videointelligence.v1beta1.VideoContext.Builder subBuilder = null;
            if (videoContext_ != null) {
              subBuilder = videoContext_.toBuilder();
            }
            videoContext_ = input.readMessage(com.google.cloud.videointelligence.v1beta1.VideoContext.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(videoContext_);
              videoContext_ = subBuilder.buildPartial();
            }

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

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

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

            inputContent_ = s;
            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 {
      if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
        features_ = java.util.Collections.unmodifiableList(features_);
      }
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1beta1_AnnotateVideoRequest_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1beta1_AnnotateVideoRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.class, com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.Builder.class);
  }

  private int bitField0_;
  public static final int INPUT_URI_FIELD_NUMBER = 1;
  private volatile java.lang.Object inputUri_;
  /**
   *

   * Input video location. Currently, only
   * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
   * supported, which must be specified in the following format:
   * `gs://bucket-id/object-id` (other URI formats return
   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
   * [Request URIs](/storage/docs/reference-uris).
   * A video URI may include wildcards in `object-id`, and thus identify
   * multiple videos. Supported wildcards: '*' to match 0 or more characters;
   * '?' to match 1 character. If unset, the input video should be embedded
   * in the request as `input_content`. If set, `input_content` should be unset.
   *

   *
   * string input_uri = 1;
   */
  public java.lang.String getInputUri() {
    java.lang.Object ref = inputUri_;
    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();
      inputUri_ = s;
      return s;
    }
  }
  /**
   *

   * Input video location. Currently, only
   * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
   * supported, which must be specified in the following format:
   * `gs://bucket-id/object-id` (other URI formats return
   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
   * [Request URIs](/storage/docs/reference-uris).
   * A video URI may include wildcards in `object-id`, and thus identify
   * multiple videos. Supported wildcards: '*' to match 0 or more characters;
   * '?' to match 1 character. If unset, the input video should be embedded
   * in the request as `input_content`. If set, `input_content` should be unset.
   *

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

  public static final int INPUT_CONTENT_FIELD_NUMBER = 6;
  private volatile java.lang.Object inputContent_;
  /**
   *

   * The video data bytes. Encoding: base64. If unset, the input video(s)
   * should be specified via `input_uri`. If set, `input_uri` should be unset.
   *

   *
   * string input_content = 6;
   */
  public java.lang.String getInputContent() {
    java.lang.Object ref = inputContent_;
    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();
      inputContent_ = s;
      return s;
    }
  }
  /**
   *

   * The video data bytes. Encoding: base64. If unset, the input video(s)
   * should be specified via `input_uri`. If set, `input_uri` should be unset.
   *

   *
   * string input_content = 6;
   */
  public com.google.protobuf.ByteString
      getInputContentBytes() {
    java.lang.Object ref = inputContent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      inputContent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int FEATURES_FIELD_NUMBER = 2;
  private java.util.List<java.lang.Integer> features_;
  private static final com.google.protobuf.Internal.ListAdapter.Converter<
      java.lang.Integer, com.google.cloud.videointelligence.v1beta1.Feature> features_converter_ =
          new com.google.protobuf.Internal.ListAdapter.Converter<
              java.lang.Integer, com.google.cloud.videointelligence.v1beta1.Feature>() {
            public com.google.cloud.videointelligence.v1beta1.Feature convert(java.lang.Integer from) {
              com.google.cloud.videointelligence.v1beta1.Feature result = com.google.cloud.videointelligence.v1beta1.Feature.valueOf(from);
              return result == null ? com.google.cloud.videointelligence.v1beta1.Feature.UNRECOGNIZED : result;
            }
          };
  /**
   *

   * Requested video annotation features.
   *

   *
   * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
   */
  public java.util.List<com.google.cloud.videointelligence.v1beta1.Feature> getFeaturesList() {
    return new com.google.protobuf.Internal.ListAdapter<
        java.lang.Integer, com.google.cloud.videointelligence.v1beta1.Feature>(features_, features_converter_);
  }
  /**
   *

   * Requested video annotation features.
   *

   *
   * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
   */
  public int getFeaturesCount() {
    return features_.size();
  }
  /**
   *

   * Requested video annotation features.
   *

   *
   * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
   */
  public com.google.cloud.videointelligence.v1beta1.Feature getFeatures(int index) {
    return features_converter_.convert(features_.get(index));
  }
  /**
   *

   * Requested video annotation features.
   *

   *
   * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
   */
  public java.util.List<java.lang.Integer>
  getFeaturesValueList() {
    return features_;
  }
  /**
   *

   * Requested video annotation features.
   *

   *
   * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
   */
  public int getFeaturesValue(int index) {
    return features_.get(index);
  }
  private int featuresMemoizedSerializedSize;

  public static final int VIDEO_CONTEXT_FIELD_NUMBER = 3;
  private com.google.cloud.videointelligence.v1beta1.VideoContext videoContext_;
  /**
   *

   * Additional video context and/or feature-specific parameters.
   *

   *
   * .google.cloud.videointelligence.v1beta1.VideoContext video_context = 3;
   */
  public boolean hasVideoContext() {
    return videoContext_ != null;
  }
  /**
   *

   * Additional video context and/or feature-specific parameters.
   *

   *
   * .google.cloud.videointelligence.v1beta1.VideoContext video_context = 3;
   */
  public com.google.cloud.videointelligence.v1beta1.VideoContext getVideoContext() {
    return videoContext_ == null ? com.google.cloud.videointelligence.v1beta1.VideoContext.getDefaultInstance() : videoContext_;
  }
  /**
   *

   * Additional video context and/or feature-specific parameters.
   *

   *
   * .google.cloud.videointelligence.v1beta1.VideoContext video_context = 3;
   */
  public com.google.cloud.videointelligence.v1beta1.VideoContextOrBuilder getVideoContextOrBuilder() {
    return getVideoContext();
  }

  public static final int OUTPUT_URI_FIELD_NUMBER = 4;
  private volatile java.lang.Object outputUri_;
  /**
   *

   * Optional location where the output (in JSON format) should be stored.
   * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
   * URIs are supported, which must be specified in the following format:
   * `gs://bucket-id/object-id` (other URI formats return
   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
   * [Request URIs](/storage/docs/reference-uris).
   *

   *
   * string output_uri = 4;
   */
  public java.lang.String getOutputUri() {
    java.lang.Object ref = outputUri_;
    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();
      outputUri_ = s;
      return s;
    }
  }
  /**
   *

   * Optional location where the output (in JSON format) should be stored.
   * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
   * URIs are supported, which must be specified in the following format:
   * `gs://bucket-id/object-id` (other URI formats return
   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
   * [Request URIs](/storage/docs/reference-uris).
   *

   *
   * string output_uri = 4;
   */
  public com.google.protobuf.ByteString
      getOutputUriBytes() {
    java.lang.Object ref = outputUri_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      outputUri_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LOCATION_ID_FIELD_NUMBER = 5;
  private volatile java.lang.Object locationId_;
  /**
   *

   * Optional cloud region where annotation should take place. Supported cloud
   * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
   * is specified, a region will be determined based on video file location.
   *

   *
   * string location_id = 5;
   */
  public java.lang.String getLocationId() {
    java.lang.Object ref = locationId_;
    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();
      locationId_ = s;
      return s;
    }
  }
  /**
   *

   * Optional cloud region where annotation should take place. Supported cloud
   * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
   * is specified, a region will be determined based on video file location.
   *

   *
   * string location_id = 5;
   */
  public com.google.protobuf.ByteString
      getLocationIdBytes() {
    java.lang.Object ref = locationId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      locationId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  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 {
    getSerializedSize();
    if (!getInputUriBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputUri_);
    }
    if (getFeaturesList().size() > 0) {
      output.writeUInt32NoTag(18);
      output.writeUInt32NoTag(featuresMemoizedSerializedSize);
    }
    for (int i = 0; i < features_.size(); i++) {
      output.writeEnumNoTag(features_.get(i));
    }
    if (videoContext_ != null) {
      output.writeMessage(3, getVideoContext());
    }
    if (!getOutputUriBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, outputUri_);
    }
    if (!getLocationIdBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, locationId_);
    }
    if (!getInputContentBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, inputContent_);
    }
  }

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

    size = 0;
    if (!getInputUriBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, inputUri_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < features_.size(); i++) {
        dataSize += com.google.protobuf.CodedOutputStream
          .computeEnumSizeNoTag(features_.get(i));
      }
      size += dataSize;
      if (!getFeaturesList().isEmpty()) {  size += 1;
        size += com.google.protobuf.CodedOutputStream
          .computeUInt32SizeNoTag(dataSize);
      }featuresMemoizedSerializedSize = dataSize;
    }
    if (videoContext_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getVideoContext());
    }
    if (!getOutputUriBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, outputUri_);
    }
    if (!getLocationIdBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, locationId_);
    }
    if (!getInputContentBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, inputContent_);
    }
    memoizedSize = size;
    return size;
  }

  private static final long serialVersionUID = 0L;
  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest other = (com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest) obj;

    boolean result = true;
    result = result && getInputUri()
        .equals(other.getInputUri());
    result = result && getInputContent()
        .equals(other.getInputContent());
    result = result && features_.equals(other.features_);
    result = result && (hasVideoContext() == other.hasVideoContext());
    if (hasVideoContext()) {
      result = result && getVideoContext()
          .equals(other.getVideoContext());
    }
    result = result && getOutputUri()
        .equals(other.getOutputUri());
    result = result && getLocationId()
        .equals(other.getLocationId());
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + INPUT_URI_FIELD_NUMBER;
    hash = (53 * hash) + getInputUri().hashCode();
    hash = (37 * hash) + INPUT_CONTENT_FIELD_NUMBER;
    hash = (53 * hash) + getInputContent().hashCode();
    if (getFeaturesCount() > 0) {
      hash = (37 * hash) + FEATURES_FIELD_NUMBER;
      hash = (53 * hash) + features_.hashCode();
    }
    if (hasVideoContext()) {
      hash = (37 * hash) + VIDEO_CONTEXT_FIELD_NUMBER;
      hash = (53 * hash) + getVideoContext().hashCode();
    }
    hash = (37 * hash) + OUTPUT_URI_FIELD_NUMBER;
    hash = (53 * hash) + getOutputUri().hashCode();
    hash = (37 * hash) + LOCATION_ID_FIELD_NUMBER;
    hash = (53 * hash) + getLocationId().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest 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 com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest 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 com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest 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(com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest 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;
  }
  /**
   *

   * Video annotation request.
   *

   *
   * Protobuf type {@code google.cloud.videointelligence.v1beta1.AnnotateVideoRequest}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1beta1.AnnotateVideoRequest)
      com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1beta1_AnnotateVideoRequest_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1beta1_AnnotateVideoRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.class, com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.Builder.class);
    }

    // Construct using com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.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();
      inputUri_ = "";

      inputContent_ = "";

      features_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000004);
      if (videoContextBuilder_ == null) {
        videoContext_ = null;
      } else {
        videoContext_ = null;
        videoContextBuilder_ = null;
      }
      outputUri_ = "";

      locationId_ = "";

      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1beta1_AnnotateVideoRequest_descriptor;
    }

    public com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest getDefaultInstanceForType() {
      return com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.getDefaultInstance();
    }

    public com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest build() {
      com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest buildPartial() {
      com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest result = new com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.inputUri_ = inputUri_;
      result.inputContent_ = inputContent_;
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        features_ = java.util.Collections.unmodifiableList(features_);
        bitField0_ = (bitField0_ & ~0x00000004);
      }
      result.features_ = features_;
      if (videoContextBuilder_ == null) {
        result.videoContext_ = videoContext_;
      } else {
        result.videoContext_ = videoContextBuilder_.build();
      }
      result.outputUri_ = outputUri_;
      result.locationId_ = locationId_;
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        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, Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest) {
        return mergeFrom((com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest other) {
      if (other == com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.getDefaultInstance()) return this;
      if (!other.getInputUri().isEmpty()) {
        inputUri_ = other.inputUri_;
        onChanged();
      }
      if (!other.getInputContent().isEmpty()) {
        inputContent_ = other.inputContent_;
        onChanged();
      }
      if (!other.features_.isEmpty()) {
        if (features_.isEmpty()) {
          features_ = other.features_;
          bitField0_ = (bitField0_ & ~0x00000004);
        } else {
          ensureFeaturesIsMutable();
          features_.addAll(other.features_);
        }
        onChanged();
      }
      if (other.hasVideoContext()) {
        mergeVideoContext(other.getVideoContext());
      }
      if (!other.getOutputUri().isEmpty()) {
        outputUri_ = other.outputUri_;
        onChanged();
      }
      if (!other.getLocationId().isEmpty()) {
        locationId_ = other.locationId_;
        onChanged();
      }
      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 {
      com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

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

     * Input video location. Currently, only
     * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
     * supported, which must be specified in the following format:
     * `gs://bucket-id/object-id` (other URI formats return
     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
     * [Request URIs](/storage/docs/reference-uris).
     * A video URI may include wildcards in `object-id`, and thus identify
     * multiple videos. Supported wildcards: '*' to match 0 or more characters;
     * '?' to match 1 character. If unset, the input video should be embedded
     * in the request as `input_content`. If set, `input_content` should be unset.
     *

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

     * Input video location. Currently, only
     * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
     * supported, which must be specified in the following format:
     * `gs://bucket-id/object-id` (other URI formats return
     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
     * [Request URIs](/storage/docs/reference-uris).
     * A video URI may include wildcards in `object-id`, and thus identify
     * multiple videos. Supported wildcards: '*' to match 0 or more characters;
     * '?' to match 1 character. If unset, the input video should be embedded
     * in the request as `input_content`. If set, `input_content` should be unset.
     *

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

     * Input video location. Currently, only
     * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
     * supported, which must be specified in the following format:
     * `gs://bucket-id/object-id` (other URI formats return
     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
     * [Request URIs](/storage/docs/reference-uris).
     * A video URI may include wildcards in `object-id`, and thus identify
     * multiple videos. Supported wildcards: '*' to match 0 or more characters;
     * '?' to match 1 character. If unset, the input video should be embedded
     * in the request as `input_content`. If set, `input_content` should be unset.
     *

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

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

     * Input video location. Currently, only
     * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
     * supported, which must be specified in the following format:
     * `gs://bucket-id/object-id` (other URI formats return
     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
     * [Request URIs](/storage/docs/reference-uris).
     * A video URI may include wildcards in `object-id`, and thus identify
     * multiple videos. Supported wildcards: '*' to match 0 or more characters;
     * '?' to match 1 character. If unset, the input video should be embedded
     * in the request as `input_content`. If set, `input_content` should be unset.
     *

     *
     * string input_uri = 1;
     */
    public Builder clearInputUri() {

      inputUri_ = getDefaultInstance().getInputUri();
      onChanged();
      return this;
    }
    /**
     *

     * Input video location. Currently, only
     * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are
     * supported, which must be specified in the following format:
     * `gs://bucket-id/object-id` (other URI formats return
     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
     * [Request URIs](/storage/docs/reference-uris).
     * A video URI may include wildcards in `object-id`, and thus identify
     * multiple videos. Supported wildcards: '*' to match 0 or more characters;
     * '?' to match 1 character. If unset, the input video should be embedded
     * in the request as `input_content`. If set, `input_content` should be unset.
     *

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

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

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

     * The video data bytes. Encoding: base64. If unset, the input video(s)
     * should be specified via `input_uri`. If set, `input_uri` should be unset.
     *

     *
     * string input_content = 6;
     */
    public java.lang.String getInputContent() {
      java.lang.Object ref = inputContent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        inputContent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *

     * The video data bytes. Encoding: base64. If unset, the input video(s)
     * should be specified via `input_uri`. If set, `input_uri` should be unset.
     *

     *
     * string input_content = 6;
     */
    public com.google.protobuf.ByteString
        getInputContentBytes() {
      java.lang.Object ref = inputContent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        inputContent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *

     * The video data bytes. Encoding: base64. If unset, the input video(s)
     * should be specified via `input_uri`. If set, `input_uri` should be unset.
     *

     *
     * string input_content = 6;
     */
    public Builder setInputContent(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }

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

     * The video data bytes. Encoding: base64. If unset, the input video(s)
     * should be specified via `input_uri`. If set, `input_uri` should be unset.
     *

     *
     * string input_content = 6;
     */
    public Builder clearInputContent() {

      inputContent_ = getDefaultInstance().getInputContent();
      onChanged();
      return this;
    }
    /**
     *

     * The video data bytes. Encoding: base64. If unset, the input video(s)
     * should be specified via `input_uri`. If set, `input_uri` should be unset.
     *

     *
     * string input_content = 6;
     */
    public Builder setInputContentBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

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

    private java.util.List<java.lang.Integer> features_ =
      java.util.Collections.emptyList();
    private void ensureFeaturesIsMutable() {
      if (!((bitField0_ & 0x00000004) == 0x00000004)) {
        features_ = new java.util.ArrayList<java.lang.Integer>(features_);
        bitField0_ |= 0x00000004;
      }
    }
    /**
     *

     * Requested video annotation features.
     *

     *
     * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
     */
    public java.util.List<com.google.cloud.videointelligence.v1beta1.Feature> getFeaturesList() {
      return new com.google.protobuf.Internal.ListAdapter<
          java.lang.Integer, com.google.cloud.videointelligence.v1beta1.Feature>(features_, features_converter_);
    }
    /**
     *

     * Requested video annotation features.
     *

     *
     * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
     */
    public int getFeaturesCount() {
      return features_.size();
    }
    /**
     *

     * Requested video annotation features.
     *

     *
     * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
     */
    public com.google.cloud.videointelligence.v1beta1.Feature getFeatures(int index) {
      return features_converter_.convert(features_.get(index));
    }
    /**
     *

     * Requested video annotation features.
     *

     *
     * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
     */
    public Builder setFeatures(
        int index, com.google.cloud.videointelligence.v1beta1.Feature value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureFeaturesIsMutable();
      features_.set(index, value.getNumber());
      onChanged();
      return this;
    }
    /**
     *

     * Requested video annotation features.
     *

     *
     * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
     */
    public Builder addFeatures(com.google.cloud.videointelligence.v1beta1.Feature value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureFeaturesIsMutable();
      features_.add(value.getNumber());
      onChanged();
      return this;
    }
    /**
     *

     * Requested video annotation features.
     *

     *
     * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
     */
    public Builder addAllFeatures(
        java.lang.Iterable<? extends com.google.cloud.videointelligence.v1beta1.Feature> values) {
      ensureFeaturesIsMutable();
      for (com.google.cloud.videointelligence.v1beta1.Feature value : values) {
        features_.add(value.getNumber());
      }
      onChanged();
      return this;
    }
    /**
     *

     * Requested video annotation features.
     *

     *
     * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
     */
    public Builder clearFeatures() {
      features_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *

     * Requested video annotation features.
     *

     *
     * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
     */
    public java.util.List<java.lang.Integer>
    getFeaturesValueList() {
      return java.util.Collections.unmodifiableList(features_);
    }
    /**
     *

     * Requested video annotation features.
     *

     *
     * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
     */
    public int getFeaturesValue(int index) {
      return features_.get(index);
    }
    /**
     *

     * Requested video annotation features.
     *

     *
     * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
     */
    public Builder setFeaturesValue(
        int index, int value) {
      ensureFeaturesIsMutable();
      features_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *

     * Requested video annotation features.
     *

     *
     * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
     */
    public Builder addFeaturesValue(int value) {
      ensureFeaturesIsMutable();
      features_.add(value);
      onChanged();
      return this;
    }
    /**
     *

     * Requested video annotation features.
     *

     *
     * repeated .google.cloud.videointelligence.v1beta1.Feature features = 2;
     */
    public Builder addAllFeaturesValue(
        java.lang.Iterable<java.lang.Integer> values) {
      ensureFeaturesIsMutable();
      for (int value : values) {
        features_.add(value);
      }
      onChanged();
      return this;
    }

    private com.google.cloud.videointelligence.v1beta1.VideoContext videoContext_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.videointelligence.v1beta1.VideoContext, com.google.cloud.videointelligence.v1beta1.VideoContext.Builder, com.google.cloud.videointelligence.v1beta1.VideoContextOrBuilder> videoContextBuilder_;
    /**
     *

     * Additional video context and/or feature-specific parameters.
     *

     *
     * .google.cloud.videointelligence.v1beta1.VideoContext video_context = 3;
     */
    public boolean hasVideoContext() {
      return videoContextBuilder_ != null || videoContext_ != null;
    }
    /**
     *

     * Additional video context and/or feature-specific parameters.
     *

     *
     * .google.cloud.videointelligence.v1beta1.VideoContext video_context = 3;
     */
    public com.google.cloud.videointelligence.v1beta1.VideoContext getVideoContext() {
      if (videoContextBuilder_ == null) {
        return videoContext_ == null ? com.google.cloud.videointelligence.v1beta1.VideoContext.getDefaultInstance() : videoContext_;
      } else {
        return videoContextBuilder_.getMessage();
      }
    }
    /**
     *

     * Additional video context and/or feature-specific parameters.
     *

     *
     * .google.cloud.videointelligence.v1beta1.VideoContext video_context = 3;
     */
    public Builder setVideoContext(com.google.cloud.videointelligence.v1beta1.VideoContext value) {
      if (videoContextBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        videoContext_ = value;
        onChanged();
      } else {
        videoContextBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *

     * Additional video context and/or feature-specific parameters.
     *

     *
     * .google.cloud.videointelligence.v1beta1.VideoContext video_context = 3;
     */
    public Builder setVideoContext(
        com.google.cloud.videointelligence.v1beta1.VideoContext.Builder builderForValue) {
      if (videoContextBuilder_ == null) {
        videoContext_ = builderForValue.build();
        onChanged();
      } else {
        videoContextBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *

     * Additional video context and/or feature-specific parameters.
     *

     *
     * .google.cloud.videointelligence.v1beta1.VideoContext video_context = 3;
     */
    public Builder mergeVideoContext(com.google.cloud.videointelligence.v1beta1.VideoContext value) {
      if (videoContextBuilder_ == null) {
        if (videoContext_ != null) {
          videoContext_ =
            com.google.cloud.videointelligence.v1beta1.VideoContext.newBuilder(videoContext_).mergeFrom(value).buildPartial();
        } else {
          videoContext_ = value;
        }
        onChanged();
      } else {
        videoContextBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *

     * Additional video context and/or feature-specific parameters.
     *

     *
     * .google.cloud.videointelligence.v1beta1.VideoContext video_context = 3;
     */
    public Builder clearVideoContext() {
      if (videoContextBuilder_ == null) {
        videoContext_ = null;
        onChanged();
      } else {
        videoContext_ = null;
        videoContextBuilder_ = null;
      }

      return this;
    }
    /**
     *

     * Additional video context and/or feature-specific parameters.
     *

     *
     * .google.cloud.videointelligence.v1beta1.VideoContext video_context = 3;
     */
    public com.google.cloud.videointelligence.v1beta1.VideoContext.Builder getVideoContextBuilder() {

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

     * Additional video context and/or feature-specific parameters.
     *

     *
     * .google.cloud.videointelligence.v1beta1.VideoContext video_context = 3;
     */
    public com.google.cloud.videointelligence.v1beta1.VideoContextOrBuilder getVideoContextOrBuilder() {
      if (videoContextBuilder_ != null) {
        return videoContextBuilder_.getMessageOrBuilder();
      } else {
        return videoContext_ == null ?
            com.google.cloud.videointelligence.v1beta1.VideoContext.getDefaultInstance() : videoContext_;
      }
    }
    /**
     *

     * Additional video context and/or feature-specific parameters.
     *

     *
     * .google.cloud.videointelligence.v1beta1.VideoContext video_context = 3;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.videointelligence.v1beta1.VideoContext, com.google.cloud.videointelligence.v1beta1.VideoContext.Builder, com.google.cloud.videointelligence.v1beta1.VideoContextOrBuilder>
        getVideoContextFieldBuilder() {
      if (videoContextBuilder_ == null) {
        videoContextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.videointelligence.v1beta1.VideoContext, com.google.cloud.videointelligence.v1beta1.VideoContext.Builder, com.google.cloud.videointelligence.v1beta1.VideoContextOrBuilder>(
                getVideoContext(),
                getParentForChildren(),
                isClean());
        videoContext_ = null;
      }
      return videoContextBuilder_;
    }

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

     * Optional location where the output (in JSON format) should be stored.
     * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
     * URIs are supported, which must be specified in the following format:
     * `gs://bucket-id/object-id` (other URI formats return
     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
     * [Request URIs](/storage/docs/reference-uris).
     *

     *
     * string output_uri = 4;
     */
    public java.lang.String getOutputUri() {
      java.lang.Object ref = outputUri_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        outputUri_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *

     * Optional location where the output (in JSON format) should be stored.
     * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
     * URIs are supported, which must be specified in the following format:
     * `gs://bucket-id/object-id` (other URI formats return
     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
     * [Request URIs](/storage/docs/reference-uris).
     *

     *
     * string output_uri = 4;
     */
    public com.google.protobuf.ByteString
        getOutputUriBytes() {
      java.lang.Object ref = outputUri_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        outputUri_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *

     * Optional location where the output (in JSON format) should be stored.
     * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
     * URIs are supported, which must be specified in the following format:
     * `gs://bucket-id/object-id` (other URI formats return
     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
     * [Request URIs](/storage/docs/reference-uris).
     *

     *
     * string output_uri = 4;
     */
    public Builder setOutputUri(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }

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

     * Optional location where the output (in JSON format) should be stored.
     * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
     * URIs are supported, which must be specified in the following format:
     * `gs://bucket-id/object-id` (other URI formats return
     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
     * [Request URIs](/storage/docs/reference-uris).
     *

     *
     * string output_uri = 4;
     */
    public Builder clearOutputUri() {

      outputUri_ = getDefaultInstance().getOutputUri();
      onChanged();
      return this;
    }
    /**
     *

     * Optional location where the output (in JSON format) should be stored.
     * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/)
     * URIs are supported, which must be specified in the following format:
     * `gs://bucket-id/object-id` (other URI formats return
     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
     * [Request URIs](/storage/docs/reference-uris).
     *

     *
     * string output_uri = 4;
     */
    public Builder setOutputUriBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

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

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

     * Optional cloud region where annotation should take place. Supported cloud
     * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
     * is specified, a region will be determined based on video file location.
     *

     *
     * string location_id = 5;
     */
    public java.lang.String getLocationId() {
      java.lang.Object ref = locationId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        locationId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *

     * Optional cloud region where annotation should take place. Supported cloud
     * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
     * is specified, a region will be determined based on video file location.
     *

     *
     * string location_id = 5;
     */
    public com.google.protobuf.ByteString
        getLocationIdBytes() {
      java.lang.Object ref = locationId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        locationId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *

     * Optional cloud region where annotation should take place. Supported cloud
     * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
     * is specified, a region will be determined based on video file location.
     *

     *
     * string location_id = 5;
     */
    public Builder setLocationId(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }

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

     * Optional cloud region where annotation should take place. Supported cloud
     * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
     * is specified, a region will be determined based on video file location.
     *

     *
     * string location_id = 5;
     */
    public Builder clearLocationId() {

      locationId_ = getDefaultInstance().getLocationId();
      onChanged();
      return this;
    }
    /**
     *

     * Optional cloud region where annotation should take place. Supported cloud
     * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region
     * is specified, a region will be determined based on video file location.
     *

     *
     * string location_id = 5;
     */
    public Builder setLocationIdBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);

      locationId_ = value;
      onChanged();
      return this;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return this;
    }

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

    // @@protoc_insertion_point(builder_scope:google.cloud.videointelligence.v1beta1.AnnotateVideoRequest)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta1.AnnotateVideoRequest)
  private static final com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest();
  }

  public static com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  public com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}


text:
  <button type="button" ng-click="cancel()" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Delete "{{category.username}}"

  <form name="editCategory" class="form-horizontal row">

        Name

          <input type="text" name="title" disabled ng-model="category.username" class="form-control" id="inputTitle">

  </form>

  <button type="button" ng-click="cancel()" class="btn btn-default" data-dismiss="modal">Close</button>
  <button type="button" ng-disabled="editCategory.$invalid" ng-click="edit(category)" class="btn btn-primary button-fix">Delete</button>

redpajama_set_name: RedPajamaGithub


text:
using System;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
using Robust.Client.GameObjects.Components.Animations;
using Robust.Shared.Animations;
using Robust.Shared.GameObjects;
using Robust.Shared.Maths;

namespace Content.Client.GameObjects.Components
{
    [RegisterComponent]
    public class EmergencyLightComponent : Component
    {
        public override string Name => "EmergencyLight";

        /// <inheritdoc/>
        protected override void Startup()
        {
            base.Startup();

            var animation = new Animation
            {
                Length = TimeSpan.FromSeconds(4),
                AnimationTracks =
                {
                    new AnimationTrackComponentProperty
                    {
                        ComponentType = typeof(PointLightComponent),
                        InterpolationMode = AnimationInterpolationMode.Linear,
                        Property = nameof(PointLightComponent.Rotation),
                        KeyFrames =
                        {
                            new AnimationTrackProperty.KeyFrame(Angle.Zero, 0),
                            new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(1080), 4)
                        }
                    }
                }
            };

            var playerComponent = Owner.EnsureComponent<AnimationPlayerComponent>();
            playerComponent.Play(animation, "emergency");

            playerComponent.AnimationCompleted += s => playerComponent.Play(animation, s);
        }
    }
}


text:
import dilap.core.base as db
import dilap.core.tools as dpr
import dilap.core.vector as dpv
import dilap.core.quaternion as dpq
import dilap.core.context as dgc
#import dilap.core.tmesh as dtm
import dilap.core.lsystem as dls
import dilap.mesh.tools as dtl
import dilap.primitive.cube as dcu
import dilap.primitive.road as dr

import pdb,numpy,math
import matplotlib.pyplot as plt

class infrastructure(dgc.context):

    def __init__(self,igraph,*args,**kwargs):
        self.igraph = igraph
        dgc.context.__init__(self,*args,**kwargs)

    def _terrain_points(self):
        self.tpts = []
        [self.tpts.extend(r.tpts) for r in self.roads]
        [self.tpts.extend(i.tpts) for i in self.intersections]
        return self.tpts

    def _hole_points(self):
        self.hpts = []
        [self.hpts.extend(r.hpts) for r in self.roads]
        [self.hpts.extend(i.hpts) for i in self.intersections]
        return self.hpts

    def generate(self,seed,boundary,worn = 0):

        #rgraph = infragraph(seed,boundary)

        ax = self.igraph.plot()
        plt.show()

        self.intersections = []
        self.roads = []
        rcs,ris = dr.graph_roads(self.igraph)
        #rcs,ris = dr.circle(dr.highway)

        self.intersections.extend([i.translate(seed) for i in ris])
        self.roads.extend([r.translate(seed) for r in rcs])

        #p = dpv.zero()
        #d = dpv.xhat.copy()
        #rmeshmodel = rmesh(-1)._realize(p,d).model
        #rmeshmodel.translate(seed)
        #self._nodes_to_graph(self._node_wrap(rmeshmodel))

        [self._nodes_to_graph(self._node_wrap(i)) for i in self.intersections]
        [self._nodes_to_graph(self._node_wrap(r)) for r in self.roads]
        return self


text:
module Shape
  ( module ShapeImpl
  , module Shape
  , module Matrix
  ) where

import Matrix
-- import Shape.Shallow as ShapeImpl
import Shape.Deep as ShapeImpl

-- | Derived combinators

scale :: Vec -> Shape -> Shape
scale v = transform (matrix  (vecX v)  0
                             0         (vecY v))

rotate :: Angle -> Shape -> Shape
rotate d = transform (matrix  c  (-s)
                              s  c   )
  where  c = cos d
         s = sin d

difference :: Shape -> Shape -> Shape
difference sh1 sh2 = sh1 `intersect` invert sh2


text:
#if !UNIX

//
//  Copyright (c) Microsoft Corporation. All rights reserved.
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//  http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//

namespace Microsoft.PackageManagement.PackageSourceListProvider
{
    using Microsoft.PackageManagement.Internal.Implementation;

    internal class ProgressTracker
    {
        internal int ProgressID;
        internal int StartPercent;
        internal int EndPercent;

        internal ProgressTracker(int progressID) : this(progressID, 0, 100) { }

        internal ProgressTracker(int progressID, int startPercent, int endPercent)
        {
            ProgressID = progressID;
            StartPercent = startPercent;
            EndPercent = endPercent;
        }

        internal int ConvertPercentToProgress(double percent)
        {
            // for example, if startprogress is 50, end progress is 100, and if we want to complete 50% of that,
            // then the progress returned would be 75
            return StartPercent + (int)((EndPercent - StartPercent) * percent);
        }

        internal static ProgressTracker StartProgress(ProgressTracker parentTracker, string message, Request request)
        {
            if (request == null)
            {
                return null;
            }

            // if parent tracker is null, use 0 for parent id, else use the progressid of parent tracker
            return new ProgressTracker(request.StartProgress(parentTracker == null ? 0 : parentTracker.ProgressID, message));
        }
    }
}

#endif


text:
import importlib
from .MemoryStream import StreamManager
from neo.Core.IO.BinaryReader import BinaryReader
from neo.logging import log_manager

logger = log_manager.getLogger()

class Helper:

    @staticmethod
    def AsSerializableWithType(buffer, class_name):
        """

        Args:
            buffer (BytesIO/bytes): stream to deserialize `class_name` to.
            class_name (str): a full path to the class to be deserialized into. e.g. 'neo.Core.Block.Block'

        Returns:
            object: if deserialization is successful.
            None: if deserialization failed.
        """
        module = '.'.join(class_name.split('.')[:-1])
        klassname = class_name.split('.')[-1]
        klass = getattr(importlib.import_module(module), klassname)
        mstream = StreamManager.GetStream(buffer)
        reader = BinaryReader(mstream)

        try:
            serializable = klass()
            serializable.Deserialize(reader)
            return serializable
        except Exception as e:
            logger.error("Could not deserialize: %s %s" % (e, class_name))
        finally:
            StreamManager.ReleaseStream(mstream)

        return None


text:
package org.sc.probro.servlets;

import java.util.*;
import java.io.*;
import java.util.regex.*;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.json.JSONException;
import org.json.JSONStringer;
import org.sc.probro.*;
import org.sc.probro.exceptions.*;

public class OntologyListServlet extends BrokerServlet {

	public OntologyListServlet(BrokerProperties props) {
		super(props);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.getRequestDispatcher("/indexer").forward(request, response);
	}

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		try {
			UserCredentials creds = new UserCredentials();
			String contentType = getContentType(request);
			String content = null;

			Broker broker = getBroker();
			Ontology[] onts = broker.listOntologies(creds);

			if(contentType.equals(CONTENT_TYPE_JSON)) {
				JSONStringer stringer = new JSONStringer();

				try {
					stringer.object();

					stringer.key("vals");
					BrokerData.stringJSONArray(stringer, onts);

					stringer.endObject();
				} catch(JSONException e) {
					throw new BrokerException(e);
				}

				content = stringer.toString();

			} else if (contentType.equals(CONTENT_TYPE_HTML)) {
				StringWriter stringer = new StringWriter();
				PrintWriter writer = new PrintWriter(stringer);

				Ontology t = new Ontology();
				writer.println("<table>");
				writer.println(t.writeHTMLRowHeader());
				for(Ontology ont : onts) {
					writer.println(ont.writeHTMLObject(true));
				}
				writer.println("</table>");

				content = stringer.toString();
			}

			response.setStatus(HttpServletResponse.SC_OK);
			response.setContentType(contentType);
			response.getWriter().println(content);

		} catch(BrokerException e) {
			handleException(response, e);
		}
	}
}


text:
<?php

namespace CachalotTest;

class RedisCacheTest extends AbstractCacheBackendTest
{
    public static function setUpBeforeClass()
    {
        if (!extension_loaded('redis')) {
            static::$cache = null;
            return;
        }

        try {
            $redis = new \Redis();
            $redis->connect('127.0.0.1');
            $redis->select(1);
            $redis->flushAll();
        }
        catch (\RedisException $e) {
            return;
        }

        static::$cache = new \Cachalot\RedisCache($redis, 'cachalot-test:');
    }

    // @todo Add serialize/unserialize tests

}


text:
cookbook_file "/etc/snmp/snmpd.conf" do
  source "snmpd.conf"
  mode "0644"
end

execute "launchctl load -w /System/Library/LaunchDaemons/org.net-snmp.snmpd.plist"


text:
package org.aesh.command.activator;

import org.aesh.command.Command;
import org.aesh.command.CommandDefinition;
import org.aesh.command.CommandException;
import org.aesh.command.CommandResult;
import org.aesh.command.completer.CompleterInvocation;
import org.aesh.command.converter.ConverterInvocation;
import org.aesh.command.impl.internal.ParsedCommand;
import org.aesh.command.impl.registry.AeshCommandRegistryBuilder;
import org.aesh.command.invocation.CommandInvocation;
import org.aesh.command.registry.CommandRegistry;
import org.aesh.command.settings.Settings;
import org.aesh.command.settings.SettingsBuilder;
import org.aesh.command.validator.ValidatorInvocation;
import org.aesh.readline.Prompt;
import org.aesh.readline.ReadlineConsole;
import org.aesh.tty.TestConnection;
import org.aesh.utils.Config;
import org.junit.Assert;
import org.junit.Test;

/**
 *
 * @author jdenise@redhat.com
 */
public class AeshCommandActivatorTest {

    @Test
    public void testActivatorFail() throws Exception {
        TestConnection connection = new TestConnection(false);

        CommandRegistry registry = AeshCommandRegistryBuilder.builder()
                .command(FooCommand.class)
                .create();

        Settings<CommandInvocation, ConverterInvocation, CompleterInvocation, ValidatorInvocation,
                        OptionActivator, CommandActivator> settings =
                SettingsBuilder.builder()
                        .logging(true)
                        .connection(connection)
                        .commandRegistry(registry)
                        .build();

        ReadlineConsole console = new ReadlineConsole(settings);

        console.setPrompt(new Prompt(""));
        console.start();

        connection.read("foo" + Config.getLineSeparator());
        Thread.sleep(200);
        Assert.assertTrue(connection.getOutputBuffer(),
                connection.getOutputBuffer().
                contains("The command is not available in the current context."));
    }

    public static class NotActived implements CommandActivator {

        @Override
        public boolean isActivated(ParsedCommand command) {
            return false;
        }

    }
    @CommandDefinition(name = "foo", description = "", activator = NotActived.class)
    public static class FooCommand implements Command {

        @Override
        public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException {
            return CommandResult.SUCCESS;
        }
    }
}


text:
package bestpractices

import (
	"fmt"
	"log"
	"net/http"
)

func doThis() error { return nil }
func doThat() error { return nil }

// HANDLER1 OMIT
func init() {
	http.HandleFunc("/", handler)
}

func handler(w http.ResponseWriter, r *http.Request) {
	err := doThis()
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		log.Printf("handling %q: %v", r.RequestURI, err)
		return
	}

	err = doThat()
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		log.Printf("handling %q: %v", r.RequestURI, err)
		return
	}
}

// HANDLER2 OMIT
func init() {
	http.HandleFunc("/", errorHandler(betterHandler))
}

func errorHandler(f func(http.ResponseWriter, *http.Request) error) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		err := f(w, r)
		if err != nil {
			http.Error(w, err.Error(), http.StatusInternalServerError)
			log.Printf("handling %q: %v", r.RequestURI, err)
		}
	}
}

func betterHandler(w http.ResponseWriter, r *http.Request) error {
	if err := doThis(); err != nil {
		return fmt.Errorf("doing this: %v", err)
	}

	if err := doThat(); err != nil {
		return fmt.Errorf("doing that: %v", err)
	}
	return nil
}

// END OMIT


text:
<asf xmlversion="1.0">
	<project caption="XPLAIN Bridge" id="lufa.projects.xplain_bridge.avr8">
		<require idref="lufa.projects.xplain_bridge"/>
		<require idref="lufa.boards.dummy.avr8"/>
		<generator value="as5_8"/>

		<device-support value="at90usb1287"/>
		<config name="lufa.drivers.board.name" value="usbkey"/>

		<build type="define" name="F_CPU" value="8000000UL"/>
		<build type="define" name="F_USB" value="8000000UL"/>
	</project>

	<module type="application" id="lufa.projects.xplain_bridge" caption="XPLAIN Bridge">
		<info type="description" value="summary">
		Bridge firmware for the original (green) XPLAIN board, for programming and USB virtual serial communications.
		</info>

 		<info type="gui-flag" value="move-to-root"/>

		<info type="keyword" value="Technology">
			<keyword value="Class Driver APIs"/>
			<keyword value="USB Device"/>
			<keyword value="CDC Class"/>
		</info>

		<device-support-alias value="lufa_avr8"/>
		<device-support-alias value="lufa_xmega"/>
		<device-support-alias value="lufa_uc3"/>

		<build type="distribute" subtype="user-file" value="doxyfile"/>
		<build type="distribute" subtype="user-file" value="XPLAINBridge.txt"/>
		<build type="distribute" subtype="user-file" value="LUFA XPLAIN Bridge.inf"/>

		<build type="c-source" value="XPLAINBridge.c"/>
		<build type="c-source" value="USARTDescriptors.c"/>
		<build type="header-file" value="XPLAINBridge.h"/>
		<build type="header-file" value="USARTDescriptors.h"/>

		<build type="c-source" value="Lib/SoftUART.c"/>
		<build type="header-file" value="Lib/SoftUART.h"/>

		<require idref="lufa.projects.avrispmkii_clone.src"/>

		<build type="module-config" subtype="path" value="Config"/>
		<build type="module-config" subtype="required-header-file" value="AppConfig.h"/>
		<build type="header-file" value="Config/AppConfig.h"/>
		<build type="header-file" value="Config/LUFAConfig.h"/>

		<require idref="lufa.common"/>
		<require idref="lufa.platform"/>
		<require idref="lufa.drivers.usb"/>
		<require idref="lufa.drivers.misc.ringbuffer"/>
		<require idref="lufa.drivers.board"/>
		<require idref="lufa.drivers.board.leds"/>
	</module>
</asf>


text:
/*
        CLPFCombFilter: implements a comb filter of length D with
                                    feedback gain m_fComb_g and LPF gain
   m_fLPF_g

        Can be used alone or as a base class.

*/

// Inherited Base Class functions:
/*
        void init(int nDelayLength);
        void resetDelay();
        void setDelay_mSec(float fmSec);
        void setOutputAttenuation_dB(float fAttendB);

        // NEED TO OVERRIDE
        bool processAudio(float *pInput, float *pOutput);
*/
#pragma once
#include "CDelay.h"

// derived from CDelay
class CLPFCombFilter : public CDelay {
public:
  // constructor/destructor
  CLPFCombFilter();
  ~CLPFCombFilter();

  // members
protected:
  float m_fComb_g; // one Comb coefficient
  float m_fLPF_g;  // one LPF coefficient
  float m_fLPF_z1; // one sample delay

public:
  // set our g value directly
  void setComb_g(float fCombg) { m_fComb_g = fCombg; }

  // set our g value using RT60
  void setComb_g_with_RTSixty(float fRT) {
    float fExponent = -3.0f * m_fDelayInSamples * (1.0f / m_nSampleRate);
    fRT /= 1000.0; // RT is in mSec!

    m_fComb_g = powf((float)10.0, fExponent / fRT);
  }

  // set the LPF gain
  // NOTE: call setComb_g_with_RTSixty FIRST, then this
  void setLPF_g(float fOverAllGain) {
    // g2 = g*(1-g1)
    m_fLPF_g = (float)fOverAllGain * (1.0f - m_fComb_g);
  }

  // overrides
  // init
  void init(int nDelayLength);

  // process something
  bool processAudio(float *pInput, float *pOutput);
};


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>

<?php /* JavaScript---*/ ?>
	<?php foreach ( $js as $jsInc ) : ?>
		<script src="<?php echo $jsInc; ?>" language="javascript" type="text/javascript"></script>
	<?php endforeach; ?>

</body>

</html>


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=UTF-8">
<TITLE>
Uses of Class org.mortbay.jetty.LocalConnector (Jetty Server Project 6.1.22 API)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../javadoc.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.mortbay.jetty.LocalConnector

Packages that use LocalConnector

org.mortbay.jetty.testing

Uses of LocalConnector in org.mortbay.jetty.testing

Methods in org.mortbay.jetty.testing that return LocalConnector

 LocalConnector
ServletTester.createLocalConnector()

          Create a Socket connector.

Methods in org.mortbay.jetty.testing with parameters of type LocalConnector

 ByteArrayBuffer
ServletTester.getResponses(ByteArrayBuffer rawRequests,
             LocalConnector connector)

          Get raw HTTP responses from raw HTTP requests.

 String
ServletTester.getResponses(String rawRequests,
             LocalConnector connector)

          Get raw HTTP responses from raw HTTP requests.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.


text:
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl\inIDOMView.idl
 */

#ifndef __gen_inIDOMView_h__
#define __gen_inIDOMView_h__

#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIDOMNode; /* forward declaration */

/* starting interface:    inIDOMView */
#define INIDOMVIEW_IID_STR "fbb67442-27a3-483c-8eb2-29c3eed7514c"

#define INIDOMVIEW_IID \
  {0xfbb67442, 0x27a3, 0x483c, \
    { 0x8e, 0xb2, 0x29, 0xc3, 0xee, 0xd7, 0x51, 0x4c }}

class NS_NO_VTABLE inIDOMView : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(INIDOMVIEW_IID)

  /* attribute nsIDOMNode rootNode; */
  NS_IMETHOD GetRootNode(nsIDOMNode * *aRootNode) = 0;
  NS_IMETHOD SetRootNode(nsIDOMNode *aRootNode) = 0;

  /* attribute boolean showAnonymousContent; */
  NS_IMETHOD GetShowAnonymousContent(bool *aShowAnonymousContent) = 0;
  NS_IMETHOD SetShowAnonymousContent(bool aShowAnonymousContent) = 0;

  /* attribute boolean showSubDocuments; */
  NS_IMETHOD GetShowSubDocuments(bool *aShowSubDocuments) = 0;
  NS_IMETHOD SetShowSubDocuments(bool aShowSubDocuments) = 0;

  /* attribute boolean showWhitespaceNodes; */
  NS_IMETHOD GetShowWhitespaceNodes(bool *aShowWhitespaceNodes) = 0;
  NS_IMETHOD SetShowWhitespaceNodes(bool aShowWhitespaceNodes) = 0;

  /* attribute boolean showAccessibleNodes; */
  NS_IMETHOD GetShowAccessibleNodes(bool *aShowAccessibleNodes) = 0;
  NS_IMETHOD SetShowAccessibleNodes(bool aShowAccessibleNodes) = 0;

  /* attribute unsigned long whatToShow; */
  NS_IMETHOD GetWhatToShow(uint32_t *aWhatToShow) = 0;
  NS_IMETHOD SetWhatToShow(uint32_t aWhatToShow) = 0;

  /* nsIDOMNode getNodeFromRowIndex (in long rowIndex); */
  NS_IMETHOD GetNodeFromRowIndex(int32_t rowIndex, nsIDOMNode * *_retval) = 0;

  /* long getRowIndexFromNode (in nsIDOMNode node); */
  NS_IMETHOD GetRowIndexFromNode(nsIDOMNode *node, int32_t *_retval) = 0;

  /* void rebuild (); */
  NS_IMETHOD Rebuild(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(inIDOMView, INIDOMVIEW_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_INIDOMVIEW \
  NS_IMETHOD GetRootNode(nsIDOMNode * *aRootNode) override; \
  NS_IMETHOD SetRootNode(nsIDOMNode *aRootNode) override; \
  NS_IMETHOD GetShowAnonymousContent(bool *aShowAnonymousContent) override; \
  NS_IMETHOD SetShowAnonymousContent(bool aShowAnonymousContent) override; \
  NS_IMETHOD GetShowSubDocuments(bool *aShowSubDocuments) override; \
  NS_IMETHOD SetShowSubDocuments(bool aShowSubDocuments) override; \
  NS_IMETHOD GetShowWhitespaceNodes(bool *aShowWhitespaceNodes) override; \
  NS_IMETHOD SetShowWhitespaceNodes(bool aShowWhitespaceNodes) override; \
  NS_IMETHOD GetShowAccessibleNodes(bool *aShowAccessibleNodes) override; \
  NS_IMETHOD SetShowAccessibleNodes(bool aShowAccessibleNodes) override; \
  NS_IMETHOD GetWhatToShow(uint32_t *aWhatToShow) override; \
  NS_IMETHOD SetWhatToShow(uint32_t aWhatToShow) override; \
  NS_IMETHOD GetNodeFromRowIndex(int32_t rowIndex, nsIDOMNode * *_retval) override; \
  NS_IMETHOD GetRowIndexFromNode(nsIDOMNode *node, int32_t *_retval) override; \
  NS_IMETHOD Rebuild(void) override;

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_INIDOMVIEW(_to) \
  NS_IMETHOD GetRootNode(nsIDOMNode * *aRootNode) override { return _to GetRootNode(aRootNode); } \
  NS_IMETHOD SetRootNode(nsIDOMNode *aRootNode) override { return _to SetRootNode(aRootNode); } \
  NS_IMETHOD GetShowAnonymousContent(bool *aShowAnonymousContent) override { return _to GetShowAnonymousContent(aShowAnonymousContent); } \
  NS_IMETHOD SetShowAnonymousContent(bool aShowAnonymousContent) override { return _to SetShowAnonymousContent(aShowAnonymousContent); } \
  NS_IMETHOD GetShowSubDocuments(bool *aShowSubDocuments) override { return _to GetShowSubDocuments(aShowSubDocuments); } \
  NS_IMETHOD SetShowSubDocuments(bool aShowSubDocuments) override { return _to SetShowSubDocuments(aShowSubDocuments); } \
  NS_IMETHOD GetShowWhitespaceNodes(bool *aShowWhitespaceNodes) override { return _to GetShowWhitespaceNodes(aShowWhitespaceNodes); } \
  NS_IMETHOD SetShowWhitespaceNodes(bool aShowWhitespaceNodes) override { return _to SetShowWhitespaceNodes(aShowWhitespaceNodes); } \
  NS_IMETHOD GetShowAccessibleNodes(bool *aShowAccessibleNodes) override { return _to GetShowAccessibleNodes(aShowAccessibleNodes); } \
  NS_IMETHOD SetShowAccessibleNodes(bool aShowAccessibleNodes) override { return _to SetShowAccessibleNodes(aShowAccessibleNodes); } \
  NS_IMETHOD GetWhatToShow(uint32_t *aWhatToShow) override { return _to GetWhatToShow(aWhatToShow); } \
  NS_IMETHOD SetWhatToShow(uint32_t aWhatToShow) override { return _to SetWhatToShow(aWhatToShow); } \
  NS_IMETHOD GetNodeFromRowIndex(int32_t rowIndex, nsIDOMNode * *_retval) override { return _to GetNodeFromRowIndex(rowIndex, _retval); } \
  NS_IMETHOD GetRowIndexFromNode(nsIDOMNode *node, int32_t *_retval) override { return _to GetRowIndexFromNode(node, _retval); } \
  NS_IMETHOD Rebuild(void) override { return _to Rebuild(); }

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_INIDOMVIEW(_to) \
  NS_IMETHOD GetRootNode(nsIDOMNode * *aRootNode) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRootNode(aRootNode); } \
  NS_IMETHOD SetRootNode(nsIDOMNode *aRootNode) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRootNode(aRootNode); } \
  NS_IMETHOD GetShowAnonymousContent(bool *aShowAnonymousContent) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetShowAnonymousContent(aShowAnonymousContent); } \
  NS_IMETHOD SetShowAnonymousContent(bool aShowAnonymousContent) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetShowAnonymousContent(aShowAnonymousContent); } \
  NS_IMETHOD GetShowSubDocuments(bool *aShowSubDocuments) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetShowSubDocuments(aShowSubDocuments); } \
  NS_IMETHOD SetShowSubDocuments(bool aShowSubDocuments) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetShowSubDocuments(aShowSubDocuments); } \
  NS_IMETHOD GetShowWhitespaceNodes(bool *aShowWhitespaceNodes) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetShowWhitespaceNodes(aShowWhitespaceNodes); } \
  NS_IMETHOD SetShowWhitespaceNodes(bool aShowWhitespaceNodes) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetShowWhitespaceNodes(aShowWhitespaceNodes); } \
  NS_IMETHOD GetShowAccessibleNodes(bool *aShowAccessibleNodes) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetShowAccessibleNodes(aShowAccessibleNodes); } \
  NS_IMETHOD SetShowAccessibleNodes(bool aShowAccessibleNodes) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetShowAccessibleNodes(aShowAccessibleNodes); } \
  NS_IMETHOD GetWhatToShow(uint32_t *aWhatToShow) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWhatToShow(aWhatToShow); } \
  NS_IMETHOD SetWhatToShow(uint32_t aWhatToShow) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetWhatToShow(aWhatToShow); } \
  NS_IMETHOD GetNodeFromRowIndex(int32_t rowIndex, nsIDOMNode * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNodeFromRowIndex(rowIndex, _retval); } \
  NS_IMETHOD GetRowIndexFromNode(nsIDOMNode *node, int32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRowIndexFromNode(node, _retval); } \
  NS_IMETHOD Rebuild(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Rebuild(); }

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class inDOMView : public inIDOMView
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_INIDOMVIEW

  inDOMView();

private:
  ~inDOMView();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(inDOMView, inIDOMView)

inDOMView::inDOMView()
{
  /* member initializers and constructor code */
}

inDOMView::~inDOMView()
{
  /* destructor code */
}

/* attribute nsIDOMNode rootNode; */
NS_IMETHODIMP inDOMView::GetRootNode(nsIDOMNode * *aRootNode)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP inDOMView::SetRootNode(nsIDOMNode *aRootNode)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute boolean showAnonymousContent; */
NS_IMETHODIMP inDOMView::GetShowAnonymousContent(bool *aShowAnonymousContent)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP inDOMView::SetShowAnonymousContent(bool aShowAnonymousContent)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute boolean showSubDocuments; */
NS_IMETHODIMP inDOMView::GetShowSubDocuments(bool *aShowSubDocuments)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP inDOMView::SetShowSubDocuments(bool aShowSubDocuments)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute boolean showWhitespaceNodes; */
NS_IMETHODIMP inDOMView::GetShowWhitespaceNodes(bool *aShowWhitespaceNodes)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP inDOMView::SetShowWhitespaceNodes(bool aShowWhitespaceNodes)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute boolean showAccessibleNodes; */
NS_IMETHODIMP inDOMView::GetShowAccessibleNodes(bool *aShowAccessibleNodes)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP inDOMView::SetShowAccessibleNodes(bool aShowAccessibleNodes)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute unsigned long whatToShow; */
NS_IMETHODIMP inDOMView::GetWhatToShow(uint32_t *aWhatToShow)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP inDOMView::SetWhatToShow(uint32_t aWhatToShow)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIDOMNode getNodeFromRowIndex (in long rowIndex); */
NS_IMETHODIMP inDOMView::GetNodeFromRowIndex(int32_t rowIndex, nsIDOMNode * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* long getRowIndexFromNode (in nsIDOMNode node); */
NS_IMETHODIMP inDOMView::GetRowIndexFromNode(nsIDOMNode *node, int32_t *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void rebuild (); */
NS_IMETHODIMP inDOMView::Rebuild()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

#endif /* __gen_inIDOMView_h__ */


text:
use std::sync::Arc;

use uuid::Uuid;

use config::action::ActionType;
use conditions::Conditions;
use state::State;
use dispatcher::response::ResponseSender;
use action::Action;
use message::Message;
use timer::TimerEvent;

pub struct BaseContext {
    name: Option<String>,
    uuid: Uuid,
    conditions: Conditions,
    actions: Vec<ActionType>,
    pub patterns: Vec<String>,
}

impl BaseContext {
    pub fn uuid(&self) -> &Uuid {
        &self.uuid
    }

    pub fn name(&self) -> Option<&String> {
        self.name.as_ref()
    }

    pub fn actions(&self) -> &[ActionType] {
        &self.actions
    }

    pub fn is_opening(&self, message: &Message) -> bool {
        if self.conditions.first_opens {
            self.patterns.first().iter().any(|first| message.ids().any(|id| &id == first))
        } else {
            true
        }
    }

    pub fn is_closing(&self, state: &State) -> bool {
        trace!("Conditions: shoud we close this context?");
        state.is_open() && self.is_closing_condition_met(state)
    }

    fn is_closing_condition_met(&self, state: &State) -> bool {
        self.is_max_size_reached(state) || self.is_closing_message(state) ||
        self.is_any_timer_expired(state)
    }

    fn is_max_size_reached(&self, state: &State) -> bool {
        self.conditions.max_size.map_or(false, |max_size| state.messages().len() >= max_size)
    }

    fn is_closing_message(&self, state: &State) -> bool {
        if self.conditions.last_closes {
            state.messages().last().iter().any(|last_message| {
                self.patterns.last().iter().any(|last| last_message.ids().any(|id| &id == last))
            })
        } else {
            false
        }
    }

    fn is_any_timer_expired(&self, state: &State) -> bool {
        self.is_timeout_expired(state) || self.is_renew_timeout_expired(state)
    }

    fn is_timeout_expired(&self, state: &State) -> bool {
        state.elapsed_time() >= self.conditions.timeout
    }

    fn is_renew_timeout_expired(&self, state: &State) -> bool {
        self.conditions.renew_timeout.map_or(false, |renew_timeout| {
            state.elapsed_time_since_last_message() >= renew_timeout
        })
    }

    pub fn on_timer(&self,
                    event: &TimerEvent,
                    state: &mut State,
                    responder: &mut ResponseSender) {
        if state.is_open() {
            state.update_timers(event);
        }
        if self.is_closing(state) {
            self.close(state, responder);
        }
    }

    pub fn on_message(&self,
                      event: Arc<Message>,
                      state: &mut State,
                      responder: &mut ResponseSender) {
        if state.is_open() {
            state.add_message(event);
        } else if self.is_opening(&event) {
            state.add_message(event);
            self.open(state, responder);
        }

        if self.is_closing(state) {
            self.close(state, responder);
        }
    }

    fn open(&self, state: &mut State, responder: &mut ResponseSender) {
        trace!("Context: opening state; uuid={}", self.uuid());
        for i in self.actions() {
            i.on_opened(state, self, responder);
        }
        state.open();
    }

    fn close(&self, state: &mut State, responder: &mut ResponseSender) {
        trace!("Context: closing state; uuid={}", self.uuid());
        for i in self.actions() {
            i.on_closed(state, self, responder);
        }
        state.close();
    }
}

pub struct BaseContextBuilder {
    name: Option<String>,
    uuid: Uuid,
    conditions: Conditions,
    actions: Vec<ActionType>,
    patterns: Vec<String>
}

impl BaseContextBuilder {
    pub fn new(uuid: Uuid, conditions: Conditions) -> BaseContextBuilder {
        BaseContextBuilder {
            name: None,
            uuid: uuid,
            conditions: conditions,
            actions: Vec::new(),
            patterns: Vec::new()
        }
    }

    pub fn name(mut self, name: Option<String>) -> BaseContextBuilder {
        self.name = name;
        self
    }

    pub fn actions(mut self, actions: Vec<ActionType>) -> BaseContextBuilder {
        self.actions = actions;
        self
    }

    pub fn patterns(mut self, patterns: Vec<String>) -> BaseContextBuilder {
        self.patterns = patterns;
        self
    }
    pub fn build(self) -> BaseContext {
        let BaseContextBuilder {name, uuid, conditions, actions, patterns} = self;
        BaseContext {
            name: name,
            uuid: uuid,
            conditions: conditions,
            actions: actions,
            patterns: patterns
        }
    }
}


text:
package org.slf4j;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.io.PrintStream;
import java.util.List;
import java.util.Random;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class IncompatibleMultiBindingAssertionTest {

    StringPrintStream sps = new StringPrintStream(System.err);
    PrintStream old = System.err;
    int diff = 1024 + new Random().nextInt(10000);

    @Before
    public void setUp() throws Exception {
        System.setErr(sps);
    }

    @After
    public void tearDown() throws Exception {
        System.setErr(old);
    }

    @Test
    public void smoke() throws Exception {
        try {
            Logger logger = LoggerFactory.getLogger(this.getClass());
            String msg = "hello world " + diff;
            logger.info(msg);
            fail("was expecting NoSuchMethodError");
        } catch (NoSuchMethodError e) {
        }
        List<String> list = sps.stringList;
        assertMsgContains(list, 0, "Class path contains multiple SLF4J bindings.");
        assertMsgContains(list, 1, "Found binding in");
        assertMsgContains(list, 2, "Found binding in");
        assertMsgContains(list, 3, "See http://www.slf4j.org/codes.html");
        assertMsgContains(list, 4, "slf4j-api 1.6.x (or later) is incompatible with this binding");
        assertMsgContains(list, 5, "Your binding is version 1.5.5 or earlier.");

    }

    void assertMsgContains(List<String> strList, int index, String msg) {
        assertTrue(((String) strList.get(index)).contains(msg));
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CliMate.interfaces.controller {
	public interface IMainController {

	}
}


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

require_once (APPPATH. "core/A_Controller.php");

class Cvideo extends A_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('Admin_m');
        $this->load->model('User_m');
        $this->load->helper(array('url','html','form'));
    }

    public function index() {
        $data['page']='admin/adm-list-video-v';
        $data['nav']='admin/nav-admin';
        $data['title'] = 'list video';
        $data['dtuser'] = $this->session->userdata('c_username');
        $data['listvideo'] = $this->Admin_m->getvideo();
        $data['userdata'] = $this->User_m->getuser();
        $data['gtuser'] = $this->User_m->detail_user($this->session->userdata('c_id'));
        $this->load->view('admin/vdashboard', $data);

    }
    public function show() {
        $this->load->view('adm-show-video-v');
    }

    public function add_video(){

        $data['page']='admin/add-video-v';
        $data['nav']='admin/nav-admin';
        $data['title'] = 'tambah video';
        $data['dtuser'] = $this->session->userdata('c_username');
        $data['dtguru'] = $this->User_m->daftar_guru();
        $data['gtuser'] = $this->User_m->detail_user($this->session->userdata('c_id'));
        $this->load->view('admin/vdashboard', $data);
    }
    public function proses_add_video(){
        $post = $this->input->post();

        $data = array(
            'judul_video'  => $post['judul_video'],
            'sinopsis' => $post['sinopsis'],
            'tgl_upload'   => $post['tgl_upload'],
            'id_kategori'   => $post['id_kategori'],
            'id_user'   => $this->session->userdata('c_id'),

        );

        if (isset($_FILES['video']['name']) && $_FILES['video']['name'] != '') {
            unset($config);
            $date = date("Ymd");
            $configVideo['upload_path'] = './assets/video';
            $configVideo['max_size'] = '100000000';
            $configVideo['allowed_types'] = 'avi|flv|wmv|mp3|mp4';
            $configVideo['overwrite'] = FALSE;
            $configVideo['remove_spaces'] = TRUE;
            $video_name = $date.$_FILES['video']['name'];
            $configVideo['file_name'] = $video_name;

            $this->load->library('upload', $configVideo);
            $this->upload->initialize($configVideo);
            if(!$this->upload->do_upload('video')) {
                echo $this->upload->display_errors('!!! Video Gagal ditambahkan Periksa Kembali Format video yang anda tambahkan !!!');
            }else{
                $videoDetails = $this->upload->data();

                $this->Admin_m->insert_video ($data);
                $this->session->set_flashdata('message', 'Video Barhasil ditambahkan');

                redirect('admin/Cvideo/add_video');
            }

        }else{
            echo "Please select a file";
        }
    }

    function get_guru_mapel(){
        $id_user = $this->input->get('id_user');
        $this->load->model('m_guru_mapel');

        $guru_mapel = $this->m_guru_mapel->get_mapel_of_guru($id_user);
        echo json_encode($guru_mapel);
    }

}


text:
module.exports =
    {
        doConvert: function(data)
        {
            return convert(data);
        }
    };

function convert(data)
{
    var json = data;

    if(typeof(data) === 'string' || data instanceof String)
    {
        json = JSON.parse(data)
    }

    var converted = {}

    converted.type     = "FeatureCollection";
    converted.features = []

    var featuresJSON = json["features"];

    for(var i = 0; i < featuresJSON.length; i++)
    {
        var feature = {}
        var properties = {}

        feature.type           = "Feature";
        feature.geometry       = featuresJSON[i].geometry;
        feature.properties     = properties
        properties.name        = featuresJSON[i].properties.Name;
        properties.neighbourhood = featuresJSON[i].properties.Neighbourhood;
        properties.owner        = featuresJSON[i].properties.Owner;
        properties.id        = featuresJSON[i].properties.OBJECTID;
        converted.features.push(feature)
    }

    return JSON.stringify(converted, null, 4);
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<rss version="0.91">
    <channel>
        <image>
            <url>http://www.example.com/image.gif</url>
            <link>http://www.example.com</link>
            <title>Image title</title>
            <width>50</width>
            <height>55</height>
            <description>Image description</description>
        </image>
    </channel>
</rss>