text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/apigeeregistry/v1/registry_service.proto

package com.google.cloud.apigeeregistry.v1;

/**
 *
 *
 *

 * Request message for RollbackApiDeployment.
 *

 *
 * Protobuf type {@code google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest}
 */
public final class RollbackApiDeploymentRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest)
    RollbackApiDeploymentRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use RollbackApiDeploymentRequest.newBuilder() to construct.
  private RollbackApiDeploymentRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private RollbackApiDeploymentRequest() {
    name_ = "";
    revisionId_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new RollbackApiDeploymentRequest();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.apigeeregistry.v1.RegistryServiceProto
        .internal_static_google_cloud_apigeeregistry_v1_RollbackApiDeploymentRequest_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.apigeeregistry.v1.RegistryServiceProto
        .internal_static_google_cloud_apigeeregistry_v1_RollbackApiDeploymentRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.class,
            com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.Builder.class);
  }

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   *
   *
   *

   * Required. The deployment being rolled back.
   *

   *
   *
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    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();
      name_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * Required. The deployment being rolled back.
   *

   *
   *
   * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int REVISION_ID_FIELD_NUMBER = 2;
  private volatile java.lang.Object revisionId_;
  /**
   *
   *
   *

   * Required. The revision ID to roll back to.
   * It must be a revision of the same deployment.
   *   Example: `c7cfa2a8`
   *

   *
   * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED];
   *
   * @return The revisionId.
   */
  @java.lang.Override
  public java.lang.String getRevisionId() {
    java.lang.Object ref = revisionId_;
    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();
      revisionId_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * Required. The revision ID to roll back to.
   * It must be a revision of the same deployment.
   *   Example: `c7cfa2a8`
   *

   *
   * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED];
   *
   * @return The bytes for revisionId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getRevisionIdBytes() {
    java.lang.Object ref = revisionId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      revisionId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, revisionId_);
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revisionId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, revisionId_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest other =
        (com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest) obj;

    if (!getName().equals(other.getName())) return false;
    if (!getRevisionId().equals(other.getRevisionId())) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (37 * hash) + REVISION_ID_FIELD_NUMBER;
    hash = (53 * hash) + getRevisionId().hashCode();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest 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.apigeeregistry.v1.RollbackApiDeploymentRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest 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.apigeeregistry.v1.RollbackApiDeploymentRequest parseFrom(
      byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest 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.apigeeregistry.v1.RollbackApiDeploymentRequest parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest 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.apigeeregistry.v1.RollbackApiDeploymentRequest parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(
      com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  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;
  }
  /**
   *
   *
   *

   * Request message for RollbackApiDeployment.
   *

   *
   * Protobuf type {@code google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest)
      com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.apigeeregistry.v1.RegistryServiceProto
          .internal_static_google_cloud_apigeeregistry_v1_RollbackApiDeploymentRequest_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.apigeeregistry.v1.RegistryServiceProto
          .internal_static_google_cloud_apigeeregistry_v1_RollbackApiDeploymentRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.class,
              com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.Builder.class);
    }

    // Construct using com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      name_ = "";

      revisionId_ = "";

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.apigeeregistry.v1.RegistryServiceProto
          .internal_static_google_cloud_apigeeregistry_v1_RollbackApiDeploymentRequest_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest
        getDefaultInstanceForType() {
      return com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest build() {
      com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest buildPartial() {
      com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest result =
          new com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest(this);
      result.name_ = name_;
      result.revisionId_ = revisionId_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest) {
        return mergeFrom((com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(
        com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest other) {
      if (other
          == com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.getDefaultInstance())
        return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (!other.getRevisionId().isEmpty()) {
        revisionId_ = other.revisionId_;
        onChanged();
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                name_ = input.readStringRequireUtf8();

                break;
              } // case 10
            case 18:
              {
                revisionId_ = input.readStringRequireUtf8();

                break;
              } // case 18
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

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

     * Required. The deployment being rolled back.
     *

     *
     *
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * Required. The deployment being rolled back.
     *

     *
     *
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @return The bytes for name.
     */
    public com.google.protobuf.ByteString getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * Required. The deployment being rolled back.
     *

     *
     *
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

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

     * Required. The deployment being rolled back.
     *

     *
     *
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. The deployment being rolled back.
     *

     *
     *
     * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     *
     *
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

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

     * Required. The revision ID to roll back to.
     * It must be a revision of the same deployment.
     *   Example: `c7cfa2a8`
     *

     *
     * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED];
     *
     * @return The revisionId.
     */
    public java.lang.String getRevisionId() {
      java.lang.Object ref = revisionId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        revisionId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * Required. The revision ID to roll back to.
     * It must be a revision of the same deployment.
     *   Example: `c7cfa2a8`
     *

     *
     * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED];
     *
     * @return The bytes for revisionId.
     */
    public com.google.protobuf.ByteString getRevisionIdBytes() {
      java.lang.Object ref = revisionId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        revisionId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * Required. The revision ID to roll back to.
     * It must be a revision of the same deployment.
     *   Example: `c7cfa2a8`
     *

     *
     * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED];
     *
     * @param value The revisionId to set.
     * @return This builder for chaining.
     */
    public Builder setRevisionId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

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

     * Required. The revision ID to roll back to.
     * It must be a revision of the same deployment.
     *   Example: `c7cfa2a8`
     *

     *
     * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED];
     *
     * @return This builder for chaining.
     */
    public Builder clearRevisionId() {

      revisionId_ = getDefaultInstance().getRevisionId();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * Required. The revision ID to roll back to.
     * It must be a revision of the same deployment.
     *   Example: `c7cfa2a8`
     *

     *
     * string revision_id = 2 [(.google.api.field_behavior) = REQUIRED];
     *
     * @param value The bytes for revisionId to set.
     * @return This builder for chaining.
     */
    public Builder setRevisionIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

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

    // @@protoc_insertion_point(builder_scope:google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest)
  private static final com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest
      DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest();
  }

  public static com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest
      getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<RollbackApiDeploymentRequest> PARSER =
      new com.google.protobuf.AbstractParser<RollbackApiDeploymentRequest>() {
        @java.lang.Override
        public RollbackApiDeploymentRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest
      getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}


text:
package org.mathiasgarnier.wintime.sktranslate;

public class OnPressurePlate {

}

redpajama_set_name: RedPajamaGithub


text:
package au.gov.ga.geodesy.domain.model.event;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.ForeignKey;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "SITE_LOG_RECEIVED")
@DiscriminatorValue("site log received")
@PrimaryKeyJoinColumn(foreignKey=@ForeignKey(name = "fk_domain_event_site_log_received"))
public class SiteLogReceived extends Event {

    @Column(name = "FOUR_CHAR_ID", nullable = false)
    private String fourCharacterId;

    @SuppressWarnings({"unused", "initialization.fields.uninitialized"}) // used by hibernate
    private SiteLogReceived() {
    }

    public SiteLogReceived(String fourCharacterId) {
        this.fourCharacterId = fourCharacterId;
    }

    public String getFourCharacterId() {
        return fourCharacterId;
    }

    /**
     * Return a Human digestable message about this event. Used in email for example.
     *
     * @return the message
     */
    @Transient
    public String getMessage() {
        String message = super.getMessage() + ", FOUR_CHAR_ID: " + getFourCharacterId();
        return message;
    }
}


text:
require 'quickies.pl'

print "Content-type: text/html\n\n";

($User,$Planet,$AuthCode,$Target,$City)=split(/&/,$ENV{QUERY_STRING});
$user_information = $MasterPath . "/User Information";
dbmopen(%authCode, "$user_information/accesscode", 0777);
if(($AuthCode ne $authCode{$User}) || ($AuthCode eq "")){
	print "";
	die;
}
dbmclose(%authCode);
&parse_form;

$SF = qq!!;
$UnitPath = "/home/bluewand/data/unitsdir";
$WeaponPath = "/home/bluewand/data/weapons";

$AttackMode = $data{'mode'};
if ($AttackeMode eq "") {$AttackMode = "Standard";}
########## Attacker:Defender Ratios: ##############
if ($AttackMode eq "Standard") {$WinRatio = 10;}
if ($AttackMode eq "Siege") {$WinRatio = 4;}
if ($AttackMode eq "Raid") {$WinRatio = 5;}
if ($AttackMode eq "Recovery") {$WinRatio = 6;}

@Types = (Ground,Air,Sea,Space);
$zappa = time();
srand($zappa);

$PlanetDir = $MasterPath . "/Planets/$Planet";
$AttackerDir = "$PlanetDir/users/$User";
$DefenderDir = "$PlanetDir/users/$Target";
$UnitDir = "/home/bluewand/data/unitsdir";
$NewsDir = "$PlanetDir/News";
$WeaponDir = "/home/bluewand/data/weapons";
$UWGDir = "$PlanetDir/UWG";

#########################################################################################################################
#
#						Get Target Data
#
#########################################################################################################################
open (IN, "$AttackerDir/City.txt");
flock (IN, 1);
@Cities = <IN>;
close (IN);
if (scalar(@Cities) == 0) {
	print "";
	$flags = 1;
	die;
}

open (DATAIN, "$AttackerDir/turns.txt");
$turns = <DATAIN>;
$turns = <DATAIN>;

close (DATAIN);
chop ($turns);

if ($turns < 72) {
	print "";
	$flags = 1;
	die;
}

open (IN, "$AttackerDir/Retal.txt");
flock (IN, 1);
@DataIn = <IN>;
close (IN);
&chopper (@DataIn);

foreach $Line (@DataIn) {
	($AgrCountry, $TurnsToAttack) = split (/,/, $Line);
	$AttackHash{$AgrCountry} = $TurnsToAttack;
}

open (IN, "$DefenderDir/located.txt");
@List = <IN>;
close (IN);
&chopper (@List);

foreach $Item (@List) {
	$FoundCountry{$Item}++;
}
$FoundCountry{$User}++;

foreach $Item (keys(%FoundCountry)) {
	push (@NewList, "$Item\n");
}

open (OUT, ">$DefenderDir/located.txt");
print OUT @NewList;
close (OUT);

open (IN, "$DefenderDir/City.txt");
@CityData = <IN>;
close (IN);
&chopper (@CityData);

$City =~ tr/_/ /;
foreach $State (@CityData) {
	($Name,$Population,$Status,$BorderLevel,$Acceptance,$Feature,$Hospitals,$Barracks,$Agriculture,$Ag,$Commercial,$Co,$Industrial,$In,$Residential,$Re,$LandSize,$FormerOwner,$CityPlanet,$Worth,$Modern,$CityType,$Schools,$PercentLeft,$TurnsLeft) = split(/\|/, $State);
	if ($Name eq $City) {$CityLocation = $BorderLevel}
	$DefendPop = int($Population * 0.12 * $Acceptance);
	$DefendPopPoints = int($DefendPop * 0.75);
}
$City =~ tr/ /_/;

#########################################################################################################################
#
#						Initialize Armies
#
#########################################################################################################################

#Check Attacking Armies For Availability

opendir (DIR, "$AttackerDir/military");
@Files = readdir(DIR);
closedir (DIR);
&IncludeIt(1);

opendir (DIR, "$DefenderDir/military");
@Files = readdir(DIR);
closedir (DIR);
&IncludeIt(2);

open (IN, "$DefenderDir/alliance.txt");
$Alliance = <IN>;
close (IN);
chop ($Alliance);
DefendersOfTheRealm;

########################################################################################################################
#
#						Combat Routine
#
#########################################################################################################################

if ($AttackerCount == 1) {

	#Calculate Attacker Damage
	foreach $Warrior (keys(%AttackerForces)) {
		$AttackerPower = &AquirePower($Warrior, $AttackerForces{$Warrior}, $AttackerPower);
	}
	#Add UWG Forces If Necessary
	if ($AttackerNetPower > (1.25 * $DefenderNetPower) && $AttackHash{$Target} < 1) {
		$Send = int($AttackerNetPower - (1.25 * $DefenderNetPower));
		&WorldGovernmentIntervention($Send);
		#Set Intervention Flag to 1
		$UWGAid = 1;
	}
	#Calculate Defender / Ally / UWG Damage
	foreach $Warrior (keys(%DefenderForces)) {
		$DefenderPower = &AquirePower($Warrior, $DefenderForces{$Warrior}, $DefenderPower);
	}

	#Distribute Casualties
	&Casualties;
#	print "- $AttackerPoints - $DefenderPoints-
";
	if ($AttackerPoints > ($DefenderPoints * $WinRatio)) {$VictoryConditions = 1;} else {$VictoryConditions = 2;}
} else {$VictoryConditions = 2;}

#print "VicCon - $VictoryConditions
";
if ($VictoryConditions < 1) {$VictoryConditions = 2;}
#print "AP:", join (',', @$AttackerPower),"
";
#print "DP:", join (',', @$DefenderPower),"
";

&AdministerVictory;
&ModifyArmies;
&Punish;
&Display;

#########################################################################################################################
#
#						SubRoutines
#
#########################################################################################################################

sub Punish
{
	open (IN, "$AttackerDir/country.txt");
	flock (IN, 1);
	@At = <IN>;
	close (IN);
	&chopper (@At);

	open (IN, "$DefenderDir/country.txt");
	flock (IN, 1);
	@De = <IN>;
	close (IN);
	&chopper (@De);

	open (IN, "$DefenderDir/Retal.txt");
	flock (IN, 1);
	@Retal = <IN>;
	close (IN);
	&chopper (@Retal);

	foreach $Line (@Retal) {
		($AgrCountry, $TurnsToAttack) = split (/,/, $Line);
		$AttackerHash{$AgrCountry} = $TurnsToAttack;
	}
	$AttackerHash{$User} += 8;

	open (OUT, ">$DefenderDir/Retal.txt");
	flock (OUT, 2);
	while (($Key, $Value) = each(%AttackerHash)) {
		print OUT "$Key,$Value\n";
	}

	close (OUT);

	#Punish if size descrepancy is too large.

	open (IN, "$AttackerDir/Retal.txt");
	flock (IN, 1);
	my @TempRetal = <IN>;
	close (IN);
	&chopper (@TempRetal);

	#Check to see if retaliation without punishment possible
	foreach $Item (@TempRetal) {
		my @Temp = split(/,/, $Item);
		if (@Temp[0] eq $Target && @Temp[1] > 0) {$AttackClear = 1;}
	}

	#Determine if punishment is applicable.
	$TotalSize = @At[8] + @De[8];
	my $TempSize = $TempPercent = 0;
	if (@At[8] > @De[8]) {$TempSize = @At[8];} else {$TempSize = @De[8];}
	$TempPercent = ($TempSize / $TotalSize);

	if ($TempPercent > 0.75 && $AttackClear != 1) {
		$User =~ tr/_/ /;
		if (@At[9] < 1) {
			$WarnMessage = qq!UWG Spokesman Corp Mathain announced today that the UWG would take action against $User if attacks against inappropriate nations were not halted immediately. As he assured world leaders that this was the UWG's first and final warning to $User, the UWG Diplomatic Office downgraded relations with the state.!;

			open (OUT, ">$NewsDir/$Year$Mon$Mday$Hour$Min$Sec".a) or print "Cannot open International for writing
";
			flock (OUT, 2);
			print OUT "UWG makes statement against $User.\n";
			print OUT "$Hour:$Min:$Sec   $Mon\/$Mday\/$Year\n";
			print OUT "$WarnMessage";
			close (OUT);
			@At[7] = "Sanctioned";

		} elsif (@At[9] == 1) {

			open (IN, "$AttackerDir/City.txt");
			flock (IN, 1);
			@ACity = <IN>;
			close (IN);
			&chopper(@ACity);
			open (IN, "$DefenderDir/City.txt");
			flock (IN, 1);
			@DCity = <IN>;
			close (IN);
			&chopper(@DCity);

			$CityTaken = int(rand(scalar(@ACity)));
			($CityName,$Population,$Status,$BorderLevel,$Acceptance,$Feature,$Hospitals,$Barracks,$Agriculture,$Ag,$Commercial,$Co,$Industrial,$In,$Residential,$Re,$LandSize,$FormerOwner,$CityPlanet,$Worth,$Modern,$CityType,$Schools,$PercentLeft,$TurnsLeft) = split(/\|/, @ACity[$CityTaken]);
			$TurnsLeft = int((scalar(@DCity)-1) * 0.2) + 1;
			$Agriculture=$Commercial=$Industrial=$Residential=0;

			open (OUT, ">>$DefenderDir/City.txt");
			flock (OUT, 2);
			print OUT qq!$CityName|$Population|$Status|$BorderLevel|$Acceptance|$Feature|$Hospitals|$Barracks|$Agriculture|$Ag|$Commercial|$Co|$Industrial|$In|$Residential|$Re|$LandSize|$FormerOwner|$CityPlanet|$Worth|$Modern|$CityType|$Schools|$PercentLeft|$TurnsLeft\n!;
			close (OUT);

			open (OUT, ">$AttackerDir/City.txt");
			flock (OUT, 2);
			for ($i=0;$i<=scalar(@ACity);$i++) {
				if ($i != $CityTaken) {print OUT "@ACity[$i]\n";}
			}
			close (OUT);

			$WarnMessage = qq!Responding to an attack by the nation of $User against a weaker country, UWG forces launched a massive suprise attack, securing the city of $CityName.  Spokesman Corp Mathain made the following statement;  "The UWG has never tolerated acts of aggression against weaker and undefensable nations.  $CityName will be given to the victim of this atrocity as reperation.  Should $User launch more attacks against our weaker brothers in the future, the punishment shall be much more severe."!;

			open (OUT, ">$NewsDir/$Year$Mon$Mday$Hour$Min$Sec".a) or print "Cannot open International for writing
";
			flock (OUT, 2);
			print OUT "UWG invades $User in response to attacks.\n";
			print OUT "$Hour:$Min:$Sec   $Mon\/$Mday\/$Year\n";
			print OUT "$WarnMessage";
			close (OUT);

			@At[7] = "Rogue";
		} elsif (@At[9] > 1 && @At[9] < 4) {
			open (IN, "$AttackerDir/City.txt");
			flock (IN, 1);
			@ACity = <IN>;
			close (IN);
			open (IN, "$DefenderDir/City.txt");
			flock (IN, 1);
			@DCity = <IN>;
			close (IN);

			$CityTaken = int(rand(scalar(@ACity)));
			($CityName,$Population,$Status,$BorderLevel,$Acceptance,$Feature,$Hospitals,$Barracks,$Agriculture,$Ag,$Commercial,$Co,$Industrial,$In,$Residential,$Re,$LandSize,$FormerOwner,$CityPlanet,$Worth,$Modern,$CityType,$Schools,$PercentLeft,$TurnsLeft) = split(/\|/, @ACity[$CityTaken]);
			$TurnsLeft = int((scalar(@DCity)-1) * 0.2) + 1;
			$Agriculture=$Commercial=$Industrial=$Residential=0;

			open (OUT, ">>$DefenderDir/City.txt");
			flock (OUT, 2);
			print OUT qq!$CityName|$Population|$Status|$BorderLevel|$Acceptance|$Feature|$Hospitals|$Barracks|$Agriculture|$Ag|$Commercial|$Co|$Industrial|$In|$Residential|$Re|$LandSize|$FormerOwner|$CityPlanet|$Worth|$Modern|$CityType|$Schools|$PercentLeft|$TurnsLeft\n!;
			close (OUT);

			open (OUT, ">$AttackerDir/City.txt");
			flock (OUT, 2);
			for ($i=0;$i<=scalar(@ACity);$i++) {
				if ($i != $CityTaken) {print OUT "@ACity[$i]\n";}
			}
			close (OUT);

			$WarnMessage = qq!The UWG launched an all-out assault against $User today, as punishment for its attacks against weaker nations.  UWG special forces secured the city of $CityName, as artillery bombardment and airstrikes flattened the remaining cities.  UWG Spokesman Corp Mathain had only the following to say;  "This is the price of unwarranted agression."!;

			open (OUT, ">$NewsDir/$Year$Mon$Mday$Hour$Min$Sec".a) or print "Cannot open International for writing
";
			flock (OUT, 2);
			print OUT "UWG invades $User in response to attacks.\n";
			print OUT "$Hour:$Min:$Sec   $Mon\/$Mday\/$Year\n";
			print OUT "$WarnMessage";
			close (OUT);

			@At[7] = "Enemy";
		} elsif (@At[9] > 3) {
			open (IN, "$AttackerDir/City.txt");
			flock (IN, 1);
			@ACity = <IN>;
			close (IN);
			open (IN, "$DefenderDir/City.txt");
			flock (IN, 1);
			@DCity = <IN>;
			close (IN);

			$CityTaken = int(rand(scalar(@ACity)));
			($CityName,$Population,$Status,$BorderLevel,$Acceptance,$Feature,$Hospitals,$Barracks,$Agriculture,$Ag,$Commercial,$Co,$Industrial,$In,$Residential,$Re,$LandSize,$FormerOwner,$CityPlanet,$Worth,$Modern,$CityType,$Schools,$PercentLeft,$TurnsLeft) = split(/\|/, @ACity[$CityTaken]);
			$TurnsLeft = int((scalar(@DCity)-1) * 0.2) + 1;
			$Agriculture=$Commercial=$Industrial=$Residential=0;

			open (OUT, ">>$DefenderDir/City.txt");
			flock (OUT, 2);
			print OUT qq!$CityName|$Population|$Status|$BorderLevel|$Acceptance|$Feature|$Hospitals|$Barracks|$Agriculture|$Ag|$Commercial|$Co|$Industrial|$In|$Residential|$Re|$LandSize|$FormerOwner|$CityPlanet|$Worth|$Modern|$CityType|$Schools|$PercentLeft|$TurnsLeft\n!;
			close (OUT);

			open (OUT, ">$AttackerDir/City.txt");
			flock (OUT, 2);
			for ($i=0;$i<=scalar(@ACity);$i++) {
				if ($i != $CityTaken) {print OUT "@ACity[$i]\n";}
			}
			close (OUT);
			$WarnMessage = qq!The UWGs on-going campaign against $User took an astonishing turn today, as a team of elite UWG Special Forces (UWG-SF) infiltrated the capital city, took control of the governmental offices, and executed every last state official, including $LeaderName.  As they carried out this assassination, UWG armies converged on military bases, supply depots and training facilities, anhiliating every last soldier and piece of equipment.  UWG Spokesman Corp Mathain declined comment.!;

			open (OUT, ">$NewsDir/$Year$Mon$Mday$Hour$Min$Sec".a) or print "Cannot open International for writing
";
			flock (OUT, 2);
			print OUT "UWG invades $User in response to attacks.\n";
			print OUT "$Hour:$Min:$Sec   $Mon\/$Mday\/$Year\n";
			print OUT "$WarnMessage";
			close (OUT);
			@At[7] = "Enemy";

			open (OUT, ">$AttackerDir/Dead.txt");
			print OUT "$WarnMessage\n";
			close (OUT);

			open (OUT, ">$AttackerDir/City.txt");
			close (OUT);
		}

		@At[9]++;
		open (OUT, ">$AttackerDir/country.txt");
		foreach $Item (@At) {
			print OUT "$Item\n";
		}
		close (OUT);
	}
}

#DisplayResults

sub Display
{
	print qq!

Combat Results

$WarnMessage
$CaptureMessage

$CasualtyScreen

	!;
}

#Change Armies to reflect attack
sub ModifyArmies
{
	foreach $Item (@AttackerNames) {
		print "Modifying $Item
";

		open (IN, "$AttackerDir/military/$Item/army.txt") or print $!;
		flock (IN, 1);
		my @Info = <IN>;
		close (IN);
		&chopper (@Info);

		if ($VictoryConditions == 1) {
			@Info[1] = -6;
			$City =~ tr/_/ /;
			@Info[8] = "Occupying $City";
			$City =~ tr/ /_/;
			print "$Item - Occupying
";
		} else {
			@Info[1] = -4;
			@Info[8] = "Regrouping";
			print "$Item - Regrouping
";
		}

		open (OUT, ">$AttackerDir/military/$Item/army.txt") or print $!;
		flock (OUT, 2);
		foreach $Item (@Info) {
			print OUT "$Item\n";
		}
		close (OUT);
	}
	foreach $Item (@DefenderNames) {
		open (IN, "$DefenderDir/military/$Item");
		flock (IN, 1);
		my @Info = <IN>;
		close (IN);
		&chopper (@Info);

		if ($VictoryConditions == 1) {
			@Info[1] = 0;
			@Info[8] = "";
		}

		open (OUT, ">$DefenderDir/military/$Item");
		flock (OUT, 2);
		foreach $Item (@Info) {
			print OUT "$Item\n";
		}
		close (OUT);

	}
}

#Administer The Victory

sub AdministerVictory

{
	open (IN, "$DefenderDir/City.txt");
	flock (IN, 1);
	@Cities = <IN>;
	close (IN);
	&chopper(@Cities);

	open (IN, "$AttackerDir/City.txt");
	flock (IN, 1);
	@AttackerCities = <IN>;
	close (IN);

	$NiceNation = $User;
	$NiceNation =~ tr/_/ /;
	$NiceDefender = $Target;
	$NiceDefender =~ tr/_/ /;

	foreach $Item (@Cities) {
		$City =~ tr/_/ /;
		($Name,$Population,$Status,$BorderLevel,$Acceptance,$Feature,$Hospitals,$Barracks,$Agriculture,$Ag,$Commercial,$Co,$Industrial,$In,$Residential,$Re,$LandSize,$FormerOwner,$CityPlanet,$Worth,$Modern,$CityType,$Schools,$PercentLeft,$TurnsLeft) = split(/\|/, $Item);
		unless ($City eq $Name) {push (@NewCities, "$Item\n");} else {
			#City is captured
			if ($AttackMode eq "Standard" && $VictoryConditions == 1) {
				$TurnsLeft = int((scalar(@AttackerCities)-1) * 0.2) + 1;
				$Agriculture=$Commercial=$Industrial=$Residential=0;
				push (@AttackerCities, qq!$Name|$Population|$Status|$BorderLevel|$Acceptance|$Feature|$Hospitals|$Barracks|$Agriculture|$Ag|$Commercial|$Co|$Industrial|$In|$Residential|$Re|$LandSize|$FormerOwner|$CityPlanet|$Worth|$Modern|$CityType|$Schools|$PercentLeft|$TurnsLeft\n!);
				$CaptureMessage = "The nation of $NiceDefender was over-run by $NiceNation.  The city of $Name has been surrendered to the attackers.";
				if ($UWGAid == 1) {$CaptureMessage .= "  United World Government forces aided in the battle, but were not enough to turn the tide against the onslaught.  UWG Miltary Spokesman Corp Mathain promised swift justice against the attackering party.\n";} else {$CaptureMessage .= "\n";}
			}
			#City Resists Attackers
			if ($AttackMode eq "Standard" && $VictoryConditions != 1) {
			 	push (@NewCities, "$Item\n");
			 	$CaptureMessage = "The nation of $NiceDefender repelled an assault conducted by $NiceNation.  The attackers were unable to capture the city of $Name.";
		 		if ($UWGAid == 1) {$CaptureMessage .="  United World Government forces participated in the successful defense, and Military Spokesman Corp Mathain pledged that the UWG would do everything in its power to deter the attacker.\n";} else {$CaptureMessage .= "\n";}
			}
			if ($AttackMode eq "Siege" && $VictoryConditions == 1) {
				$PercentLeft -= (0.10 +  (0.15 * (($Barracks/($LandSize + $Hospitals + $Schools + $Barracks)))));
	  			#Determine if City is actually captured
	  			if ($PercentLeft <= 0) {
	  				#City has been captured
	  				$TurnsLeft = int((scalar(@AttackerCities)-1) * 0.2) + 1;
	  				$PercentLeft = 0.50;
					$Agriculture=$Commercial=$Industrial=$Residential=0;
					push (@AttackerCities, qq!$Name|$Population|$Status|$BorderLevel|$Acceptance|$Feature|$Hospitals|$Barracks|$Agriculture|$Ag|$Commercial|$Co|$Industrial|$In|$Residential|$Re|$LandSize|$FormerOwner|$CityPlanet|$Worth|$Modern|$CityType|$Schools|$PercentLeft|$TurnsLeft\n!);
	  				$CaptureMessage = "The city of $Name in $NiceDefender has finally succumbed to the besieging forces of $NiceNation.";
	  				if ($UWGAid == 1) {$CaptureMessage .= "  UWG assistance was unable to prevent the capture of $Name.  UWG Spokesman Corp Mathain promised that the UWG would not stand idly by.";} else {$CaptureMessage .= "\n";}
	  			} else {
	  				#City stands free
	  				push (@NewCities, qq!$Name|$Population|$Status|$BorderLevel|$Acceptance|$Feature|$Hospitals|$Barracks|$Agriculture|$Ag|$Commercial|$Co|$Industrial|$In|$Residential|$Re|$LandSize|$FormerOwner|$CityPlanet|$Worth|$Modern|$CityType|$Schools|$PercentLeft|$TurnsLeft\n!);
	  				$CaptureMessage = "The city of $Name in $NiceDefender has managed to hold off besieging attackers of $NiceNation once again.";
	  				if ($UWGAid == 1) {$CaptureMessage .= "  UWG soldiers participated in the victory.  According to UWG Spokesman Corp Mathain, the UWG would take action against the attacker.";} else {$CaptureMessage .= "\n";}
	  			}
			}
		}
	}

	open (OUT, ">$DefenderDir/City.txt");
	flock (OUT, 2);
	print OUT @NewCities;
	close (OUT);

	open (OUT, ">$AttackerDir/City.txt");
	flock (OUT, 2);
	print OUT @AttackerCities;
	close (OUT);
	$DefenderMessage = $CaptureMessage ."

$CasualtyScreen";

	($Sec,$Min,$Hour,$Mday,$Mon,$Year,$Wday,$Yday,$Isdst) = localtime(time);
	if (length($Sec) == 1) {$Sec = "0$Sec"}
	if (length($Min) == 1) {$Min = "0$Min"}
	if (length($Hour) == 1) {$Hour = "0$Hour"}
	$Mon ++;
	$Year += 1900;

	open (OUT, ">$NewsDir/$Year$Mon$Mday$Hour$Min$Sec") or print "Cannot open International for writing
";
	flock (OUT, 2);
	print OUT "$AttackMode attack conducted in $NiceDefender by $NiceNation.\n";
	print OUT "$Hour:$Min:$Sec   $Mon\/$Mday\/$Year\n";
	print OUT "$CaptureMessage";
	close (OUT);

	#Alert Defender
	open (OUT, ">$DefenderDir/events/$Year$Month$Mday$Hour$Min$Sec.vnt") or print "Cannot open National for writing
";
	flock (OUT, 2);
	print OUT "$AttackMode attack conducted in $NiceDefender by $NiceNation.\n";
	print OUT "$Hour:$Min:$Sec   $Mon\/$Mday\/$Year\n";
	print OUT "$DefenderMessage";
	close (OUT);

	#Alert Allies
	foreach $Item (keys(%AidList)) {
		open (OUT, ">$AidList{$Item}/events/$Year$Month$Mday$Hour$Min$Sec.vnt");
		flock (OUT, 2);
		print OUT "Your armies have assisted $NiceDefender defend against a $AttackMode attack conducted by $NiceNation.\n";
		print OUT "$Hour:$Min:$Sec   $Mon\/$Mday\/$Year\n";
		print OUT "$DefenderMessage";
		close (OUT);
	}
}

#Call Real Casualty Sub Based On Army Type

sub Casualties

{
#	print "Casualties
";
#	print "Attacker Armies: ", @AttackerNames, "
";
#	print "Defender Armies: ", @DefenderNames, "

";

	foreach $Item (@AttackerNames) {
		#Call InflictCasualties sub (Army, Attacker Type)
		&InflictCasualties($Item, 0);
	}
	foreach $Item (@DefenderNames) {
		#Call InflictCasualties sub (Army, Defender Type)
		&InflictCasualties($Item, 1);
	}
	foreach $Item (@AidListing) {
		#Call InflictCasualties sub (Army, Ally Type)
		&InflictCasualties($Item, 2);
	}
}

sub InflictCasualties

{

#	print "Inflict
";
	my ($ArmyName, $ArmyType) = @_;
	if ($ArmyType == 0) {$ArmyPath = "$AttackerDir/military/$ArmyName";}
	if ($ArmyType == 1) {$ArmyPath = "$DefenderDir/military/$ArmyName";}
	if ($ArmyType == 2) {$ArmyPath = "$AidList{$ArmyName}/military/$ArmyName";}

	opendir (DIR, $ArmyPath);
	@ArmyFiles = readdir (DIR);
	closedir (DIR);

	foreach $Unit (@ArmyFiles) {
		if ($Unit eq "army.txt" || $Unit eq "." || $Unit eq "..") {} else {
			open (IN, "$ArmyPath/$Unit");
			flock (IN, 1);
			$NumberOfUnits = <IN>;
			close (IN);
			chomp ($NumberOfUnits);

			if (-e "$UnitDir/$Unit") {
				open (IN, "$UnitDir/$Unit") or print "Cannot open Unit File ($Unit)
";
				flock (IN, 1);
				@UnitData = <IN>;
				close (IN);
				&chopper (@UnitData);

				if (@UnitData[0] eq "Armour") {$DamageType = "Ground";$DamageTypeNum = 0}
				if (@UnitData[0] eq "Infantry") {$DamageType = "Ground";$DamageTypeNum = 0;}

				if ($ArmyType == 0) {
					if ($AttackerForcesType{$DamageType} > 0) {
						$PercentOfDamage = $NumberOfUnits/$AttackerForcesType{$DamageType};
						$DamageInflicted = int($PercentOfDamage * @$DefenderPower[$DamageTypeNum]);
#						print qq!$DamageInflicted = int($PercentOfDamage * @$DefenderPower[$DamageTypeNum]);
!;
					} else {$DamageInflicted = 0;}
				} else {
					if ($DefenderForcesType{$DamageType} > 0) {
						$PercentOfDamage = $NumberOfUnits/$DefenderForcesType{$DamageType};
						$DamageInflicted = int($PercentOfDamage * @$AttackerPower[$DamageTypeNum]);
					} else {$DamageInflicted = 0;}
				}

				#Kills = Damage/Health
				$Kills = int($DamageInflicted/@UnitData[5]);
				if ($Kills > $NumberOfUnits) {$Kills = $NumberOfUnits;$NumberOfUnits = 0;} else {$NumberOfUnits -= $Kills;}

				if ($NumberOfUnits == 0) {
					unlink ("$ArmyPath/$Unit");
				} else {
					open (OUT, ">$ArmyPath/$Unit") or print "Cannot open file for unit modifications (1)
";
					flock (OUT, 2);
					print OUT "$NumberOfUnits\n";
				}
				$Unit =~ s/.unt/.num/;
				open (IN, "$ArmyPath/../$Unit");
				flock (IN, 1);
				@TotalArmyNumbers = <IN>;
				close (IN);
				&chopper (@TotalArmyNumbers);
				@TotalArmyNumbers[0] -= $Kills;

				if (@TotalArmyNumbers[0] <= 0) {
					unlink ("$ArmyPath/../$Unit");
				} else {
					open (OUT, ">$ArmyPath/../$Unit") or print "Cannot open file for unit modifications (2)
";
					flock (OUT, 2);
					print OUT "@TotalArmyNumbers[0]\n";
					print OUT "@TotalArmyNumbers[1]\n";
					close (OUT);
				}

				#Number of Units * Generation
				if (@UnitData[0] eq "Armour") {$Points = ($NumberOfUnits * @UnitData[20] * 6);}
				if (@UnitData[0] eq "Infantry") {$Points = ($NumberOfUnits * @UnitData[20] * 3);}

				if ($ArmyType == 0) {$AttackerPoints += $Points;} else {$DefenderPoints += $Points;}

				#Format Names -
				$ArmyName =~ tr/_/ /;
				$Kills = &Space($Kills);
				$Unit =~ tr/_/ /;
				$Unit =~ s/.num//;
				$CasualtyScreen .= qq!$ArmyName has lost $Kills $Unit
!;
			}
		}
	}
}

#UWG Assist Defender If Necessary

sub WorldGovernmentIntervention

{
	my $Commit = @_;
	#Declare Variables
	my $Troop, $Numbers;
	$Numbers = int($Commit/4);

	$UWGSoldiers{"UWG AntiArmour Infantry"} += int($Numbers/125075);
	$DefenderForces{"UWG AntiArmour Infantry"} += int($Numbers/125075);
	$TotalDefenders += int($Numbers/125075);

	$UWGSoldiers{"UWG Infantry"} += int($Numbers/124075);
	$DefenderForces{"UWG Infantry"} += int($Numbers/124075);
	$TotalDefenders += int($Numbers/124075);

	$UWGSoldiers{"UWG Armoured Enforcer"} += int($Numbers/1658500);
	$DefenderForces{"UWG Armoured Enforcer"} += int


text:
class Favorite < ActiveRecord::Base
  belongs_to :user
  belongs_to :favorable, polymorphic: true
end


text:
from ..tables.auctionhouse import AuctionHouse
from .worker import Worker
import sqlalchemy

class Browser(Worker):
    """
    Auction House browser.

    :param db: database object
    """
    def __init__(self, db, **kwargs):
        super(Browser, self).__init__(db, **kwargs)

    def count(self):
        """
        Get the number of rows.
        """
        with self.scopped_session() as session:
            return session.query(AuctionHouse).count()

    def getStock(self, itemid, stack=False, seller=None):
        """
        Get stock of item.

        :param itemid: item number
        :param stack: consider stacks
        :param seller: consider seller

        :type itemid: int
        :type stack: int
        :type seller: int
        """
        with self.capture(fail=self.fail):
            # validate
            itemid = AuctionHouse.validate_itemid(itemid)
            stack  = AuctionHouse.validate_stack(stack)

            # perform query
            with self.scopped_session() as session:

                # ignore seller
                if seller is None:
                    N = session.query(AuctionHouse).filter(
                        AuctionHouse.itemid == itemid,
                        AuctionHouse.stack  == stack,
                        AuctionHouse.sale   == 0,
                    ).count()
                    return N

                # consider seller
                else:
                    seller = AuctionHouse.validate_seller(seller)
                    N = session.query(AuctionHouse).filter(
                        AuctionHouse.itemid == itemid,
                        AuctionHouse.seller == seller,
                        AuctionHouse.stack  == stack,
                        AuctionHouse.sale   == 0,
                    ).count()
                    return N

    def getPrice(self, itemid, stack=False, seller=None, func=sqlalchemy.func.min):
        """
        Get price of item.

        :param itemid: item number
        :param stack: consider stacks
        :param seller: consider seller

        :type itemid: int
        :type stack: int
        :type seller: int
        """
        with self.capture(fail=self.fail):
            # validate
            itemid = AuctionHouse.validate_itemid(itemid)
            stack  = AuctionHouse.validate_stack(stack)

            # perform query
            with self.scopped_session() as session:

                # ignore seller
                if seller is None:
                    N = session.query(func(AuctionHouse.sale)).filter(
                        AuctionHouse.itemid == itemid,
                        AuctionHouse.stack  == stack,
                        AuctionHouse.sale   != 0,
                    ).scalar()
                    return N

                # consider seller
                else:
                    seller = AuctionHouse.validate_seller(seller)
                    N = session.query(func(AuctionHouse.sale)).filter(
                        AuctionHouse.itemid == itemid,
                        AuctionHouse.seller == seller,
                        AuctionHouse.stack  == stack,
                        AuctionHouse.sale   != 0,
                    ).scalar()
                    return N

if __name__ == '__main__':
    pass


text:
package test;

import GUI.WindowsPrincipal;

public class GUITest {

	public static void main(String[] args) {
		WindowsPrincipal principal =  new WindowsPrincipal();
		principal.setVisible(true);
	}
}


text:
package org.iproduct.flowdemo;

import java.util.concurrent.CompletionException;
import java.util.concurrent.Executor;
import java.util.concurrent.Flow;
import java.util.concurrent.Flow.Subscription;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.SubmissionPublisher;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.function.Supplier;

public class FlowProcessor<I, O> extends SubmissionPublisher<O> implements Flow.Processor<I, O> {
	private static final int MAX_BUFFER_CAPACITY = 1024;
	private static final String LOG_FORMAT = "  Processor >> [%s] %s%n";
	private final Function<? super I, ? extends O> function;
	private Subscription subscription;

	FlowProcessor(Executor executor, int maxBufferCapacity, Function<? super I, ? extends O> function) {
		super(executor, maxBufferCapacity);
		this.function = function;
	}

	@Override
	public void onSubscribe(Flow.Subscription subscription) {
		(this.subscription = subscription).request(1);
	}

	@Override
	public void onNext(I item) {
		subscription.request(1);
		O output = function.apply(item);
		log("Transforming: %s --> %s", item, output);
		submit(output);

	}

	@Override
	public void onError(Throwable ex) {
		closeExceptionally(ex);
	}

	@Override
	public void onComplete() {
		close();
	}

	private void log(String message, Object... args) {
		String formatted = String.format(LOG_FORMAT, Thread.currentThread().getName(), message);
		System.out.printf(formatted, args);
	}

	public static void main(String[] args) {
		AtomicInteger i = new AtomicInteger(0);
		Supplier<? extends Integer> supplier = () -> i.incrementAndGet();
		// Supplier<? extends String> supplier = () -> {
		// if( i.get() != 13 )
		// return "result-" + i.incrementAndGet();
		// else
		// throw new RuntimeException("Exception - result can not be 13!");
		// };

		CompletableFuturePublisher<Integer> publisher = new CompletableFuturePublisher<>(ForkJoinPool.commonPool(), MAX_BUFFER_CAPACITY, supplier,
				1, TimeUnit.SECONDS);

		FlowProcessor<Integer, String> transformer =
			new FlowProcessor<>(ForkJoinPool.commonPool(), MAX_BUFFER_CAPACITY, n -> "transformation-result-" + n);

		FlowSubscriber<String> subA = new FlowSubscriber<>("A");
		subA.setDemand(5);

		FlowSubscriber<String> subB = new FlowSubscriber<>("B");
		subB.setDemand(10);

		publisher.subscribe(transformer);
		transformer.subscribe(subA);
		transformer.subscribe(subB);

		CompletableFutureFromPublisher<?> complete = new CompletableFutureFromPublisher<>(publisher);
		try {
			complete.join();
		} catch (CompletionException ex) {
			System.out.println("Demo completed with error: " + ex.getMessage());
		}

		System.out.println("Demo finished.");
	}

}


text:
package psidev.psi.mi.jami.xml.model.extension;

import com.sun.xml.bind.Locatable;
import com.sun.xml.bind.annotation.XmlLocation;
import org.xml.sax.Locator;
import psidev.psi.mi.jami.datasource.FileSourceContext;
import psidev.psi.mi.jami.datasource.FileSourceLocator;
import psidev.psi.mi.jami.model.*;
import psidev.psi.mi.jami.utils.CvTermUtils;
import psidev.psi.mi.jami.xml.XmlEntryContext;
import psidev.psi.mi.jami.xml.listener.PsiXmlParserListener;
import psidev.psi.mi.jami.xml.model.extension.xml300.*;

import javax.xml.bind.annotation.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * Xml implementation of ParticipantEvidence
 *
 * @author Marine Dumousseau (marine@ebi.ac.uk)
 * @version $Id$
 * @since
08/10/13

 */
@XmlAccessorType(XmlAccessType.NONE)
public class XmlParticipantEvidence extends AbstractXmlParticipant<InteractionEvidence, FeatureEvidence> implements
        ExtendedPsiXmlParticipantEvidence {

    @XmlLocation
    @XmlTransient
    private Locator locator;
    private boolean initialisedMethods = false;
    private ExtendedPsiXmlInteractionEvidence originalInteraction;
    private JAXBParticipantIdentificationWrapper jaxbParticipantionIdentificationWrapper;
    private JAXBExperimentalPreparationWrapper jaxbExperimentalPreparationWrapper;
    private JAXBExperimentalRoleWrapper jaxbExperimentalRoleWrapper;
    private JAXBExperimentalInteractorWrapper jaxbExperimentalInteractorWrapper;
    private JAXBHostOrganismWrapper jaxbHostOrganismWrapper;
    private JAXBConfidenceWrapper jaxbConfidenceWrapper;
    private JAXBParameterWrapper jaxbParameterWrapper;
    private List<ExperimentalCvTerm> originalIdentificationMethods;

    /**
     *
Constructor for XmlParticipantEvidence.

     */
    public XmlParticipantEvidence() {
    }

    /**
     *
Constructor for XmlParticipantEvidence.

     *
     * @param interactor a {@link psidev.psi.mi.jami.model.Interactor} object.
     */
    public XmlParticipantEvidence(Interactor interactor) {
        super(interactor);
    }

    /**
     *
Constructor for XmlParticipantEvidence.

     *
     * @param interactor a {@link psidev.psi.mi.jami.model.Interactor} object.
     * @param bioRole a {@link psidev.psi.mi.jami.model.CvTerm} object.
     */
    public XmlParticipantEvidence(Interactor interactor, CvTerm bioRole) {
        super(interactor, bioRole);
    }

    /**
     *
Constructor for XmlParticipantEvidence.

     *
     * @param interactor a {@link psidev.psi.mi.jami.model.Interactor} object.
     * @param stoichiometry a {@link psidev.psi.mi.jami.model.Stoichiometry} object.
     */
    public XmlParticipantEvidence(Interactor interactor, Stoichiometry stoichiometry) {
        super(interactor, stoichiometry);
    }

    /**
     *
Constructor for XmlParticipantEvidence.

     *
     * @param interactor a {@link psidev.psi.mi.jami.model.Interactor} object.
     * @param bioRole a {@link psidev.psi.mi.jami.model.CvTerm} object.
     * @param stoichiometry a {@link psidev.psi.mi.jami.model.Stoichiometry} object.
     */
    public XmlParticipantEvidence(Interactor interactor, CvTerm bioRole, Stoichiometry stoichiometry) {
        super(interactor, bioRole, stoichiometry);
    }

    /**
     *
initialiseExperimentalPreparationWrapper.

     */
    protected void initialiseExperimentalPreparationWrapper() {
        this.jaxbExperimentalPreparationWrapper = new JAXBExperimentalPreparationWrapper();
    }

    /**
     *
initialiseExperimentalRoleWrapper.

     */
    protected void initialiseExperimentalRoleWrapper() {
        this.jaxbExperimentalRoleWrapper = new JAXBExperimentalRoleWrapper();
    }

    /**
     *
initialiseConfidenceWrapper.

     */
    protected void initialiseConfidenceWrapper() {
        this.jaxbConfidenceWrapper = new JAXBConfidenceWrapper();
    }

    /**
     *
initialiseParameterWrapper.

     */
    protected void initialiseParameterWrapper() {
        this.jaxbParameterWrapper = new JAXBParameterWrapper();
    }

    /**
     *
initialiseIdentificationMethodWrapper.

     */
    protected void initialiseIdentificationMethodWrapper(){
        Collection<Experiment> expToIgnore = Collections.EMPTY_LIST;

        if (this.jaxbParticipantionIdentificationWrapper == null){
            this.jaxbParticipantionIdentificationWrapper = new JAXBParticipantIdentificationWrapper();
        }

        if (originalInteraction != null){

            List<ExtendedPsiXmlExperiment> originalExperiments = originalInteraction.getOriginalExperiments();
            if (originalExperiments != null && !originalExperiments.isEmpty()){
                // participant identification method overrides the one in the experiment
                if (originalIdentificationMethods != null && !originalIdentificationMethods.isEmpty()
                        && originalExperiments.size() == 1){
                    this.originalIdentificationMethods = null;
                }
                else{
                    if (originalIdentificationMethods != null){
                        expToIgnore = new ArrayList<Experiment>(originalIdentificationMethods.size());
                        for (ExperimentalCvTerm part : this.originalIdentificationMethods){
                            if (!part.getExperiments().isEmpty()){
                                expToIgnore.addAll(part.getExperiments());
                            }
                        }
                        this.originalIdentificationMethods = null;
                    }

                    for (ExtendedPsiXmlExperiment exp : originalExperiments){
                        if (exp.getParticipantIdentificationMethod() != null && !expToIgnore.contains(exp)){
                            this.jaxbParticipantionIdentificationWrapper.identificationMethods.add(exp.getParticipantIdentificationMethod());
                        }
                    }
                }
            }
        }

        initialisedMethods = true;
    }

    /**
     *
initialiseHostOrganismWrapper.

     */
    protected void initialiseHostOrganismWrapper() {
        this.jaxbHostOrganismWrapper = new JAXBHostOrganismWrapper();
    }

    /**
     *
initialiseExperimentalInteractorWrapper.

     */
    protected void initialiseExperimentalInteractorWrapper() {
        this.jaxbExperimentalInteractorWrapper = new JAXBExperimentalInteractorWrapper();
    }

    /**
     *
getExperimentalRole.

     *
     * @return a {@link psidev.psi.mi.jami.model.CvTerm} object.
     */
    public CvTerm getExperimentalRole() {
        if (this.jaxbExperimentalRoleWrapper == null){
            initialiseExperimentalRoleWrapper();
        }
        if (this.jaxbExperimentalRoleWrapper.experimentalRoles.isEmpty()){
            this.jaxbExperimentalRoleWrapper.experimentalRoles.add(0, new ExperimentalCvTerm(Participant.UNSPECIFIED_ROLE, new XmlXref(CvTermUtils.createPsiMiDatabase(), Participant.UNSPECIFIED_ROLE_MI, CvTermUtils.createIdentityQualifier())));
        }
        return this.jaxbExperimentalRoleWrapper.experimentalRoles.get(0);
    }

    /** {@inheritDoc} */
    public void setExperimentalRole(CvTerm expRole) {
        if (this.jaxbExperimentalRoleWrapper == null && expRole != null){
            initialiseExperimentalRoleWrapper();
            this.jaxbExperimentalRoleWrapper.experimentalRoles.add(0, expRole);
        }
        else if (expRole != null){
            if (!this.jaxbExperimentalRoleWrapper.experimentalRoles.isEmpty()){
                this.jaxbExperimentalRoleWrapper.experimentalRoles.remove(0);
            }
            this.jaxbExperimentalRoleWrapper.experimentalRoles.add(0, expRole);
        }
        else{
            if (!this.jaxbExperimentalRoleWrapper.experimentalRoles.isEmpty()){
                this.jaxbExperimentalRoleWrapper.experimentalRoles.remove(0);
            }
        }
    }

    /**
     *
getIdentificationMethods.

     *
     * @return a {@link java.util.Collection} object.
     */
    public Collection<CvTerm> getIdentificationMethods() {
        if (!initialisedMethods){
            initialiseIdentificationMethodWrapper();
        }
        return this.jaxbParticipantionIdentificationWrapper.identificationMethods;
    }

    /**
     *
getExperimentalPreparations.

     *
     * @return a {@link java.util.Collection} object.
     */
    public Collection<CvTerm> getExperimentalPreparations() {
        if (jaxbExperimentalPreparationWrapper == null){
            initialiseExperimentalPreparationWrapper();
        }
        return this.jaxbExperimentalPreparationWrapper.experimentalPreparations;
    }

    /**
     *
getExpressedInOrganism.

     *
     * @return a {@link psidev.psi.mi.jami.model.Organism} object.
     */
    public Organism getExpressedInOrganism() {
        return (this.jaxbHostOrganismWrapper != null && !this.jaxbHostOrganismWrapper.hostOrganisms.isEmpty())? this.jaxbHostOrganismWrapper.hostOrganisms.iterator().next() : null;
    }

    /** {@inheritDoc} */
    public void setExpressedInOrganism(Organism organism) {
        if (this.jaxbHostOrganismWrapper == null && organism != null){
            initialiseHostOrganismWrapper();
            this.jaxbHostOrganismWrapper.hostOrganisms.add(organism);
        }
        else if (organism != null){
            if (!this.jaxbHostOrganismWrapper.hostOrganisms.isEmpty()){
                this.jaxbHostOrganismWrapper.hostOrganisms.remove(0);
            }
            this.jaxbHostOrganismWrapper.hostOrganisms.add(0, organism);
        }
        else{
            if (!this.jaxbHostOrganismWrapper.hostOrganisms.isEmpty()){
                this.jaxbHostOrganismWrapper.hostOrganisms.remove(0);
            }
        }
    }

    /**
     *
getConfidences.

     *
     * @return a {@link java.util.Collection} object.
     */
    public Collection<Confidence> getConfidences() {
        if (jaxbConfidenceWrapper == null){
            initialiseConfidenceWrapper();
        }
        return this.jaxbConfidenceWrapper.confidences;
    }

    /**
     *
getParameters.

     *
     * @return a {@link java.util.Collection} object.
     */
    public Collection<Parameter> getParameters() {
        if (this.jaxbParameterWrapper == null){
            initialiseParameterWrapper();
        }
        return this.jaxbParameterWrapper.parameters;
    }

    /** {@inheritDoc} */
    @Override
    public List<Organism> getHostOrganisms() {
        if (this.jaxbHostOrganismWrapper == null){
            initialiseHostOrganismWrapper();
        }
        return this.jaxbHostOrganismWrapper.hostOrganisms;
    }

    /**
     *
getExperimentalInteractors.

     *
     * @return a {@link java.util.List} object.
     */
    public List<ExperimentalInteractor> getExperimentalInteractors() {
        if (this.jaxbExperimentalInteractorWrapper == null){
            initialiseExperimentalInteractorWrapper();
        }
        return this.jaxbExperimentalInteractorWrapper.experimentalInteractors;
    }

    /** {@inheritDoc} */
    @Override
    public List<CvTerm> getExperimentalRoles() {
        if (this.jaxbExperimentalRoleWrapper == null){
            initialiseExperimentalRoleWrapper();
            this.jaxbExperimentalRoleWrapper.experimentalRoles.add(0, new ExperimentalCvTerm(Participant.UNSPECIFIED_ROLE, new XmlXref(CvTermUtils.createPsiMiDatabase(), Participant.UNSPECIFIED_ROLE_MI, CvTermUtils.createIdentityQualifier())));
        }
        return this.jaxbExperimentalRoleWrapper.experimentalRoles;
    }

    /** {@inheritDoc} */
    @Override
    @XmlElement(name = "names")
    public void setJAXBNames(NamesContainer value) {
        super.setJAXBNames(value);
    }

    /** {@inheritDoc} */
    @Override
    @XmlElement(name = "xref")
    public void setJAXBXref(XrefContainer value) {
        super.setJAXBXref(value);
    }

    /** {@inheritDoc} */
    @Override
    @XmlElement(name = "interactor")
    public void setJAXBInteractor(XmlInteractor interactor) {
        super.setJAXBInteractor(interactor);
    }

    /** {@inheritDoc} */
    @Override
    @XmlElement(name = "interactionRef")
    public void setJAXBInteractionRef(Integer value) {
        super.setJAXBInteractionRef(value);
    }

    /** {@inheritDoc} */
    @Override
    @XmlElement(name = "interactorRef")
    public void setJAXBInteractorRef(Integer value) {
        super.setJAXBInteractorRef(value);
    }

    /** {@inheritDoc} */
    @Override
    @XmlElement(name = "biologicalRole")
    public void setJAXBBiologicalRole(XmlCvTerm bioRole) {
        super.setJAXBBiologicalRole(bioRole);
    }

    /**
     *
setJAXBId.

     *
     * @param value a int.
     */
    @XmlAttribute(name = "id", required = true)
    public void setJAXBId(int value) {
        super.setId(value);
    }

    /** {@inheritDoc} */
    @Override
    @XmlElement(name="attributeList")
    public void setJAXBAttributeWrapper(JAXBAttributeWrapper jaxbAttributeWrapper) {
        super.setJAXBAttributeWrapper(jaxbAttributeWrapper);
    }

    /**
     *
setFeatureWrapper.

     *
     * @param jaxbFeatureWrapper a {@link psidev.psi.mi.jami.xml.model.extension.XmlParticipantEvidence.JAXBFeatureWrapper} object.
     */
    @XmlElement(name = "featureList")
    public void setFeatureWrapper(JAXBFeatureWrapper jaxbFeatureWrapper) {
        super.setFeatureWrapper(jaxbFeatureWrapper);
    }

    /**
     *
setJAXBParticipantIdentificationMethodWrapper.

     *
     * @param wrapper a {@link psidev.psi.mi.jami.xml.model.extension.XmlParticipantEvidence.JAXBParticipantIdentificationWrapper} object.
     */
    @XmlElement(name="participantIdentificationMethodList")
    public void setJAXBParticipantIdentificationMethodWrapper(JAXBParticipantIdentificationWrapper wrapper) {
        this.jaxbParticipantionIdentificationWrapper = wrapper;
        // needs to initialise originalIdentificationMethods
        if (this.jaxbParticipantionIdentificationWrapper != null && !this.jaxbParticipantionIdentificationWrapper.identificationMethods.isEmpty()){
            this.originalIdentificationMethods = new ArrayList<ExperimentalCvTerm>(this.jaxbParticipantionIdentificationWrapper.identificationMethods.size());
            for (CvTerm v : this.jaxbParticipantionIdentificationWrapper.identificationMethods){
                this.originalIdentificationMethods.add((ExperimentalCvTerm)v);
            }
        }
    }

    /**
     *
setJAXBExperimentalRoleWrapper.

     *
     * @param wrapper a {@link psidev.psi.mi.jami.xml.model.extension.XmlParticipantEvidence.JAXBExperimentalRoleWrapper} object.
     */
    @XmlElement(name="experimentalRoleList")
    public void setJAXBExperimentalRoleWrapper(JAXBExperimentalRoleWrapper wrapper) {
        this.jaxbExperimentalRoleWrapper = wrapper;
        if (this.jaxbExperimentalRoleWrapper != null && this.jaxbExperimentalRoleWrapper.experimentalRoles.size() > 1 ){
            PsiXmlParserListener listener = XmlEntryContext.getInstance().getListener();
            if (listener != null){
                listener.onSeveralExperimentalRolesFound(this.jaxbExperimentalRoleWrapper.experimentalRoles, this.jaxbExperimentalRoleWrapper.getSourceLocator());
            }
        }
    }

    /**
     *
setJAXBExperimentalPreparationWrapper.

     *
     * @param wrapper a {@link psidev.psi.mi.jami.xml.model.extension.XmlParticipantEvidence.JAXBExperimentalPreparationWrapper} object.
     */
    @XmlElement(name="experimentalPreparationList")
    public void setJAXBExperimentalPreparationWrapper(JAXBExperimentalPreparationWrapper wrapper) {
        this.jaxbExperimentalPreparationWrapper = wrapper;
    }

    /**
     *
setExperimentalInteractorWrapper.

     *
     * @param wrapper a {@link psidev.psi.mi.jami.xml.model.extension.XmlParticipantEvidence.JAXBExperimentalInteractorWrapper} object.
     */
    @XmlElement(name="experimentalInteractorList")
    public void setExperimentalInteractorWrapper(JAXBExperimentalInteractorWrapper wrapper) {
        this.jaxbExperimentalInteractorWrapper = wrapper;
    }

    /**
     *
setJAXBHostOrganismWrapper.

     *
     * @param wrapper a {@link psidev.psi.mi.jami.xml.model.extension.XmlParticipantEvidence.JAXBHostOrganismWrapper} object.
     */
    @XmlElement(name="hostOrganismList")
    public void setJAXBHostOrganismWrapper(JAXBHostOrganismWrapper wrapper) {
        this.jaxbHostOrganismWrapper = wrapper;
        if (this.jaxbHostOrganismWrapper != null && this.jaxbHostOrganismWrapper.hostOrganisms.size() > 1 ){
            PsiXmlParserListener listener = XmlEntryContext.getInstance().getListener();
            if (listener != null){
                listener.onSeveralExpressedInOrganismFound(this.jaxbHostOrganismWrapper.hostOrganisms, this.jaxbHostOrganismWrapper.getSourceLocator());
            }
        }
    }

    /**
     *
setJAXBParameterWrapper.

     *
     * @param wrapper a {@link psidev.psi.mi.jami.xml.model.extension.XmlParticipantEvidence.JAXBParameterWrapper} object.
     */
    @XmlElement(name="parameterList")
    public void setJAXBParameterWrapper(JAXBParameterWrapper wrapper) {
        this.jaxbParameterWrapper = wrapper;
    }

    /**
     *
setJAXBConfidenceWrapper.

     *
     * @param wrapper a {@link psidev.psi.mi.jami.xml.model.extension.XmlParticipantEvidence.JAXBConfidenceWrapper} object.
     */
    @XmlElement(name="confidenceList")
    public void setJAXBConfidenceWrapper(JAXBConfidenceWrapper wrapper) {
        this.jaxbConfidenceWrapper = wrapper;
    }

    /** {@inheritDoc} */
    @Override
    @XmlElement(name="stoichiometry", namespace = "http://psi.hupo.org/mi/mif300")
    public void setJAXBStoichiometry(psidev.psi.mi.jami.xml.model.extension.xml300.XmlStoichiometry stoichiometry) {
        super.setJAXBStoichiometry(stoichiometry);
    }

    /**
     *
setJAXBInteractorCandidates.

     *
     * @param pool a {@link psidev.psi.mi.jami.xml.model.extension.XmlParticipantEvidence.JAXBInteractorCandidatesWrapper} object.
     */
    @XmlElement(name="interactorCandidateList", namespace = "http://psi.hupo.org/mi/mif300")
    public void setJAXBInteractorCandidates(JAXBInteractorCandidatesWrapper pool) {
        super.setJAXBInteractorCandidates(pool);
    }

    /** {@inheritDoc} */
    @Override
    @XmlElement(name="stoichiometryRange", namespace = "http://psi.hupo.org/mi/mif300")
    public void setJAXBStoichiometryRange(XmlStoichiometryRange stoichiometry) {
        super.setJAXBStoichiometryRange(stoichiometry);
    }

    /** {@inheritDoc} */
    @Override
    public FileSourceLocator getSourceLocator() {
        if (super.getSourceLocator() == null && locator != null){
            super.setSourceLocator(new PsiXmlLocator(locator.getLineNumber(), locator.getColumnNumber(), getId()));
        }
        return super.getSourceLocator();
    }

    /** {@inheritDoc} */
    @Override
    public void processAddedFeature(FeatureEvidence feature) {
        ((XmlFeatureEvidence)feature).setOriginalParticipant(this);
    }

    /**
     *
setOriginalXmlInteraction.

     *
     * @param i a {@link psidev.psi.mi.jami.xml.model.extension.ExtendedPsiXmlInteractionEvidence} object.
     */
    protected void setOriginalXmlInteraction(ExtendedPsiXmlInteractionEvidence i){
        this.originalInteraction = i;
        setInteraction(i);
    }

    /**
     *
Getter for the field originalInteraction.

     *
     * @return a {@link psidev.psi.mi.jami.xml.model.extension.ExtendedPsiXmlInteractionEvidence} object.
     */
    protected ExtendedPsiXmlInteractionEvidence getOriginalInteraction() {
        return originalInteraction;
    }

    /** {@inheritDoc} */
    @Override
    protected void initialiseFeatureWrapper() {
        super.setFeatureWrapper(new JAXBFeatureWrapper());
    }

    ////////////////////////////////////////////////////// classes
    @XmlAccessorType(XmlAccessType.NONE)
    @XmlType(name="participantEvidenceFeatureWrapper")
    public static class JAXBFeatureWrapper extends AbstractXmlParticipant.JAXBFeatureWrapper<FeatureEvidence> {

        public JAXBFeatureWrapper(){
            super();
        }

        @XmlElement(type=XmlFeatureEvidence.class, name="feature", required = true)
        public List<FeatureEvidence> getJAXBFeatures() {
            return super.getJAXBFeatures();
        }
    }

    @XmlAccessorType(XmlAccessType.NONE)
    @XmlType(name="participantEvidenceIdentificationWrapper")
    public static class JAXBParticipantIdentificationWrapper implements Locatable, FileSourceContext {
        private PsiXmlLocator sourceLocator;
        @XmlLocation
        @XmlTransient
        private Locator locator;
        private List<CvTerm> identificationMethods;

        public JAXBParticipantIdentificationWrapper(){
            initialiseIdentificationMethods();
        }

        @Override
        public Locator sourceLocation() {
            return (Locator)getSourceLocator();
        }

        public FileSourceLocator getSourceLocator() {
            if (sourceLocator == null && locator != null){
                sourceLocator = new PsiXmlLocator(locator.getLineNumber(), locator.getColumnNumber(), null);
            }
            return sourceLocator;
        }

        public void setSourceLocator(FileSourceLocator sourceLocator) {
            if (sourceLocator == null){
                this.sourceLocator = null;
            }
            else if (sourceLocator instanceof PsiXmlLocator){
                this.sourceLocator = (PsiXmlLocator)sourceLocator;
            }
            else {
                this.sourceLocator = new PsiXmlLocator(sourceLocator.getLineNumber(), sourceLocator.getCharNumber(), null);
            }
        }

        @XmlElement(type=ExperimentalCvTerm.class, name="participantIdentificationMethod", required = true)
        public List<CvTerm> getJAXBParticipantIdentificationMethods() {
            return this.identificationMethods;
        }

        protected void initialiseIdentificationMethods(){
            this.identificationMethods = new ArrayList<CvTerm>();
        }

        @Override
        public String toString() {
            return "Participant Identification method List: "+(getSourceLocator() != null ? getSourceLocator().toString():super.toString());
        }
    }

    @XmlAccessorType(XmlAccessType.NONE)
    @XmlType(name="participantEvidencePreparationWrapper")
    public static class JAXBExperimentalPreparationWrapper implements Locatable, FileSourceContext {
        private PsiXmlLocator sourceLocator;
        @XmlLocation
        @XmlTransient
        private Locator locator;
        private List<CvTerm> experimentalPreparations;

        public JAXBExperimentalPreparationWrapper(){
            initialiseExperimentalPreparations();
        }

        @Override
        public Locator sourceLocation() {
            return (Locator)getSourceLocator();
        }

        public FileSourceLocator getSourceLocator() {
            if (sourceLocator == null && locator != null){
                sourceLocator = new PsiXmlLocator(locator.getLineNumber(), locator.getColumnNumber(), null);
            }
            return sourceLocator;
        }

        public void setSourceLocator(FileSourceLocator sourceLocator) {
            if (sourceLocator == null){
                this.sourceLocator = null;
            }
            else if (sourceLocator instanceof PsiXmlLocator){
                this.sourceLocator = (PsiXmlLocator)sourceLocator;
            }
            else {
                this.sourceLocator = new PsiXmlLocator(sourceLocator.getLineNumber(), sourceLocator.getCharNumber(), null);
            }
        }

        @XmlElement(type=ExperimentalCvTerm.class, name="experimentalPreparation", required = true)
        public List<CvTerm> getJAXBExperimentalPreparations() {
            return this.experimentalPreparations;
        }

        protected void initialiseExperimentalPreparations(){
            this.experimentalPreparations = new ArrayList<CvTerm>();
        }

        @Override
        public String toString() {
            return "Participant Experimental Preparation List: "+(getSourceLocator() != null ? getSourceLocator().toString():super.toString());
        }
    }

    @XmlAccessorType(XmlAccessType.NONE)
    @XmlType(name="participantEvidenceRoleWrapper")
    public static class JAXBExperimentalRoleWrapper implements Locatable, FileSourceContext {
        private PsiXmlLocator sourceLocator;
        @XmlLocation
        @XmlTransient
        private Locator locator;
        private List<CvTerm> experimentalRoles;

        public JAXBExperimentalRoleWrapper(){
            initialiseExperimentalRoles();
        }

        @Override
        public Locator sourceLocation() {
            return (Locator)getSourceLocator();
        }

        public FileSourceLocator getSourceLocator() {
            if (sourceLocator == null && locator != null){
                sourceLocator = new PsiXmlLocator(locator.getLineNumber(), locator.getColumnNumber(), null);
            }
            return sourceLocator;
        }

        public void setSourceLocator(FileSourceLocator sourceLocator) {
            if (sourceLocator == null){
                this.sourceLocator = null;
            }
            else if (sourceLocator instanceof PsiXmlLocator){
                this.sourceLocator = (PsiXmlLocator)sourceLocator;
            }
            else {
                this.sourceLocator = new PsiXmlLocator(sourceLocator.getLineNumber(), sourceLocator.getCharNumber(), null);
            }
        }

        @XmlElement(type=ExperimentalCvTerm.class, name="experimentalRole", required = true)
        public List<CvTerm> getJAXBExperimentalRoles() {
            return this.experimentalRoles;
        }

        protected void initialiseExperimentalRoles(){
            this.experimentalRoles = new ArrayList<CvTerm>();
        }

        @Override
        public String toString() {
            return "Participant Experimental Role List: "+(getSourceLocator() != null ? getSourceLocator().toString():super.toString());
        }
    }

    @XmlAccessorType(XmlAccessType.NONE)
    @XmlType(name="participantEvidenceInteractorWrapper")
    public static class JAXBExperimentalInteractorWrapper implements Locatable, FileSourceContext {
        private PsiXmlLocator sourceLocator;
        @XmlLocation
        @XmlTransient
        private Locator locator;
        private List<ExperimentalInteractor> experimentalInteractors;

        public JAXBExperimentalInteractorWrapper(){
            initialiseExperimentalIneteractors();
        }

        @Override
        public Locator sourceLocation() {
            return (Locator)getSourceLocator();
        }

        public FileSourceLocator getSourceLocator() {
            if (sourceLocator == null && locator != null){
                sourceLocator = new PsiXmlLocator(locator.getLineNumber(), locator.getColumnNumber(), null);
            }
            return sourceLocator;
        }

        public void setSourceLocator(FileSourceLocator sourceLocator) {
            if (sourceLocator == null){
                this.sourceLocator = null;
            }
            else if (sourceLocator instanceof PsiXmlLocator){
                this.sourceLocator = (PsiXmlLocator)sourceLocator;
            }
            else {
                this.sourceLocator = new PsiXmlLocator(sourceLocator.getLineNumber(), sourceLocator.getCharNumber(), null);
            }
        }

        @XmlElement(type=ExperimentalInteractor.class, name="experimentalInteractor", required = true)
        public List<ExperimentalInteractor> getJAXBExperimentalInteractors() {
            return this.experimentalInteractors;
        }

        protected void initialiseExperimentalIneteractors(){
            this.experimentalInteractors = new ArrayList<ExperimentalInteractor>();
        }

        @Override
        public String toString() {
            return "Participant Experimental Interactor List: "+(getSourceLocator() != null ? getSourceLocator().toString():super.toString());
        }
    }

    @XmlAccessorType(XmlAccessType.NONE)
    @XmlType(name="participantEvidenceOrganismWrapper")
    public static class JAXBHostOrganismWrapper implements Locatable, FileSourceContext {
        private PsiXmlLocator sourceLocator;
        @XmlLocation
        @XmlTransient
        private Locator locator;
        private List<Organism> hostOrganisms;

        public JAXBHostOrganismWrapper(){
            initialiseHostOrganisms();
        }

        @Override
        public Locator sourceLocation() {
            return (Locator)getSourceLocator();
        }

        public FileSourceLocator getSourceLocator() {
            if (sourceLocator == null && locator != null){
                sourceLocator = new PsiXmlLocator(locator.getLineNumber(), locator.getColumnNumber(), null);
            }
            return sourceLocator;
        }

        public void setSourceLocator(FileSourceLocator sourceLocator) {
            if (sourceLocator == null){
                this.sourceLocator = null;
            }
            else if (sourceLocator instanceof PsiXmlLocator){
                this.sourceLocator = (PsiXmlLocator)sourceLocator;
            }
            else {
                this.sourceLocator = new PsiXmlLocator(sourceLocator.getLineNumber(), sourceLocator.getCharNumber(), null);
            }
        }

        @XmlElement(type=HostOrganism.class, name="hostOrganism", required = true)
        public List<Organism> getJAXBHostOrganisms() {
            return this.hostOrganisms;
        }

        protected void initialiseHostOrganisms(){
            this.hostOrganisms = new ArrayList<Organism>();
        }

        @Override
        public String toString() {
            return "Participant Host Organism List: "+(getSourceLocator() != null ? getSourceLocator().toString():super.toString());
        }
    }

    @XmlAccessorType(XmlAccessType.NONE)
    @XmlType(name="participantEvidenceConfidenceWrapper")
    public static class JAXBConfidenceWrapper implements Locatable, FileSourceContext {
        private PsiXmlLocator sourceLocator;
        @XmlLocation
        @XmlTransient
        private Locator locator;
        private List<Confidence> confidences;

        public JAXBConfidenceWrapper(){
            initialiseConfidences();
        }

        @Override
        public Locator sourceLocation() {
            return (Locator)getSourceLocator();
        }

        public FileSourceLocator getSourceLocator() {
            if (sourceLocator == null && locator != null){
                sourceLocator = new PsiXmlLocator(locator.getLineNumber(), locator.getColumnNumber(), null);
            }
            return sourceLocator;
        }

        public void setSourceLocator(FileSourceLocator sourceLocator) {
            if (sourceLocator == null){
                this.sourceLocator = null;
            }
            else if (sourceLocator instanceof PsiXmlLocator){
                this.sourceLocator = (PsiXmlLocator)sourceLocator;
            }
            else {
                this.sourceLocator = new PsiXmlLocator(sourceLocator.getLineNumber(), sourceLocator.getCharNumber(), null);
            }
        }

        @XmlElement(type=XmlConfidence.class, name="confidence", required = true)
        public List<Confidence> getJAXBConfidences() {
            return this.confidences;
        }

        protected void initialiseConfidences(){
            this.confidences = new ArrayList<Confidence>();
        }

        @Override
        public String toString() {
            return "Participant Confidence List: "+(getSourceLocator() != null ? getSourceLocator().toString():super.toString());
        }
    }

    @XmlAccessorType(XmlAccessType.NONE)
    @XmlType(name="participantEvidenceParameterWrapper")
    public static class JAXBParameterWrapper implements Locatable, FileSourceContext {
        private PsiXmlLocator sourceLocator;
        @XmlLocation
        @XmlTransient
        private Locator locator;
        private List<Parameter> parameters;

        public JAXBParameterWrapper(){
            initialiseParameters();
        }

        @Override
        public Locator sourceLocation() {
            return (Locator)getSourceLocator();
        }

        public FileSourceLocator getSourceLocator() {
            if (sourceLocator == null && locator != null){
                sourceLocator = new PsiXmlLocator(locator.getLineNumber(), locator.getColumnNumber(), null);
            }
            return sourceLocator;
        }

        public void setSourceLocator(FileSourceLocator sourceLocator) {
            if (sourceLocator == null){
                this.sourceLocator = null;
            }
            else if (sourceLocator instanceof PsiXmlLocator){
                this.sourceLocator = (PsiXmlLocator)sourceLocator;
            }
            else {
                this.sourceLocator = new PsiXmlLocator(sourceLocator.getLineNumber(), sourceLocator.getCharNumber(), null);
            }
        }

        @XmlElement(type=XmlParameter.class, name="parameter", required = true)
        public List<Parameter> getJAXBParameters() {
            return this.parameters;
        }

        protected void initialiseParameters(){
            this.parameters = new ArrayList<Parameter>();
        }

        @Override
        public String toString() {
            return "Participant Parameter List: "+(getSourceLocator() != null ? getSourceLocator().toString():super.toString());
        }
    }

    @XmlAccessorType(XmlAccessType.NONE)
    @XmlType(name="participantEvidenceInteractorCandidateWrapper", namespace = "http://psi.hupo.org/mi/mif300")
    public static class JAXBInteractorCandidatesWrapper extends
            AbstractXmlParticipant.JAXBInteractorCandidateWrapper<InteractionEvidence, FeatureEvidence, ExperimentalParticipantCandidate> {

        @Override
        protected void initialisePool() {
            super.setPool(new XmlExperimentalParticipantPool());
        }

        @Override
        @XmlElement(name="interactorCandidate", namespace = "http://psi.hupo.org/mi/mif300", type = XmlExperimentalParticipantCandidate.class)
        public Collection<ExperimentalParticipantCandidate> getCandidates() {
            return super.getCandidates();
        }
    }
}