Source: proto/spine/server/entity/entity_pb.js

// source: spine/server/entity/entity.proto
/**
 * @fileoverview
 * @enhanceable
 * @suppress {messageConventions} JS Compiler reports an error if a variable or
 *     field starts with 'MSG_' and isn't a translatable message.
 * @public
 */
// GENERATED CODE -- DO NOT EDIT!

var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();

var spine_options_pb = require('../../../spine/options_pb.js');
goog.object.extend(proto, spine_options_pb);
var google_protobuf_any_pb = require('../../../google/protobuf/any_pb.js');
goog.object.extend(proto, google_protobuf_any_pb);
var spine_core_version_pb = require('../../../spine/core/version_pb.js');
goog.object.extend(proto, spine_core_version_pb);
goog.exportSymbol('proto.spine.server.entity.EntityRecord', null, global);
goog.exportSymbol('proto.spine.server.entity.EntityRecordChange', null, global);
goog.exportSymbol('proto.spine.server.entity.EntityStateValidationError', null, global);
goog.exportSymbol('proto.spine.server.entity.LifecycleFlags', null, global);
/**
 * Generated by JsPbCodeGenerator.
 * @param {Array=} opt_data Optional initial data array, typically from a
 * server response, or constructed directly in Javascript. The array is used
 * in place and becomes part of the constructed object. It is not cloned.
 * If no data is provided, the constructed object will be empty, but still
 * valid.
 * @extends {jspb.Message}
 * @constructor
 */
proto.spine.server.entity.EntityRecord = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.server.entity.EntityRecord, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.server.entity.EntityRecord.displayName = 'proto.spine.server.entity.EntityRecord';
}
/**
 * Generated by JsPbCodeGenerator.
 * @param {Array=} opt_data Optional initial data array, typically from a
 * server response, or constructed directly in Javascript. The array is used
 * in place and becomes part of the constructed object. It is not cloned.
 * If no data is provided, the constructed object will be empty, but still
 * valid.
 * @extends {jspb.Message}
 * @constructor
 */
proto.spine.server.entity.LifecycleFlags = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.server.entity.LifecycleFlags, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.server.entity.LifecycleFlags.displayName = 'proto.spine.server.entity.LifecycleFlags';
}
/**
 * Generated by JsPbCodeGenerator.
 * @param {Array=} opt_data Optional initial data array, typically from a
 * server response, or constructed directly in Javascript. The array is used
 * in place and becomes part of the constructed object. It is not cloned.
 * If no data is provided, the constructed object will be empty, but still
 * valid.
 * @extends {jspb.Message}
 * @constructor
 */
proto.spine.server.entity.EntityRecordChange = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.server.entity.EntityRecordChange, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.spine.server.entity.EntityRecordChange.displayName = 'proto.spine.server.entity.EntityRecordChange';
}



if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * Optional fields that are not set will be set to undefined.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
 *     JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @return {!Object}
 */
proto.spine.server.entity.EntityRecord.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.server.entity.EntityRecord.toObject(opt_includeInstance, this);
};


/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
 *     the JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.spine.server.entity.EntityRecord} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.entity.EntityRecord.toObject = function(includeInstance, msg) {
  var f, obj = {
    entityId: (f = msg.getEntityId()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
    state: (f = msg.getState()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
    version: (f = msg.getVersion()) && spine_core_version_pb.Version.toObject(includeInstance, f),
    lifecycleFlags: (f = msg.getLifecycleFlags()) && proto.spine.server.entity.LifecycleFlags.toObject(includeInstance, f)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}


/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.spine.server.entity.EntityRecord}
 */
proto.spine.server.entity.EntityRecord.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.server.entity.EntityRecord;
  return proto.spine.server.entity.EntityRecord.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.server.entity.EntityRecord} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.server.entity.EntityRecord}
 */
proto.spine.server.entity.EntityRecord.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new google_protobuf_any_pb.Any;
      reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
      msg.setEntityId(value);
      break;
    case 2:
      var value = new google_protobuf_any_pb.Any;
      reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
      msg.setState(value);
      break;
    case 3:
      var value = new spine_core_version_pb.Version;
      reader.readMessage(value,spine_core_version_pb.Version.deserializeBinaryFromReader);
      msg.setVersion(value);
      break;
    case 4:
      var value = new proto.spine.server.entity.LifecycleFlags;
      reader.readMessage(value,proto.spine.server.entity.LifecycleFlags.deserializeBinaryFromReader);
      msg.setLifecycleFlags(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.spine.server.entity.EntityRecord.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.spine.server.entity.EntityRecord.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.spine.server.entity.EntityRecord} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.entity.EntityRecord.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getEntityId();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      google_protobuf_any_pb.Any.serializeBinaryToWriter
    );
  }
  f = message.getState();
  if (f != null) {
    writer.writeMessage(
      2,
      f,
      google_protobuf_any_pb.Any.serializeBinaryToWriter
    );
  }
  f = message.getVersion();
  if (f != null) {
    writer.writeMessage(
      3,
      f,
      spine_core_version_pb.Version.serializeBinaryToWriter
    );
  }
  f = message.getLifecycleFlags();
  if (f != null) {
    writer.writeMessage(
      4,
      f,
      proto.spine.server.entity.LifecycleFlags.serializeBinaryToWriter
    );
  }
};


/**
 * optional google.protobuf.Any entity_id = 1;
 * @return {?proto.google.protobuf.Any}
 */
proto.spine.server.entity.EntityRecord.prototype.getEntityId = function() {
  return /** @type{?proto.google.protobuf.Any} */ (
    jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 1));
};


/**
 * @param {?proto.google.protobuf.Any|undefined} value
 * @return {!proto.spine.server.entity.EntityRecord} returns this
*/
proto.spine.server.entity.EntityRecord.prototype.setEntityId = function(value) {
  return jspb.Message.setWrapperField(this, 1, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.entity.EntityRecord} returns this
 */
proto.spine.server.entity.EntityRecord.prototype.clearEntityId = function() {
  return this.setEntityId(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.server.entity.EntityRecord.prototype.hasEntityId = function() {
  return jspb.Message.getField(this, 1) != null;
};


/**
 * optional google.protobuf.Any state = 2;
 * @return {?proto.google.protobuf.Any}
 */
proto.spine.server.entity.EntityRecord.prototype.getState = function() {
  return /** @type{?proto.google.protobuf.Any} */ (
    jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 2));
};


/**
 * @param {?proto.google.protobuf.Any|undefined} value
 * @return {!proto.spine.server.entity.EntityRecord} returns this
*/
proto.spine.server.entity.EntityRecord.prototype.setState = function(value) {
  return jspb.Message.setWrapperField(this, 2, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.entity.EntityRecord} returns this
 */
proto.spine.server.entity.EntityRecord.prototype.clearState = function() {
  return this.setState(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.server.entity.EntityRecord.prototype.hasState = function() {
  return jspb.Message.getField(this, 2) != null;
};


/**
 * optional spine.core.Version version = 3;
 * @return {?proto.spine.core.Version}
 */
proto.spine.server.entity.EntityRecord.prototype.getVersion = function() {
  return /** @type{?proto.spine.core.Version} */ (
    jspb.Message.getWrapperField(this, spine_core_version_pb.Version, 3));
};


/**
 * @param {?proto.spine.core.Version|undefined} value
 * @return {!proto.spine.server.entity.EntityRecord} returns this
*/
proto.spine.server.entity.EntityRecord.prototype.setVersion = function(value) {
  return jspb.Message.setWrapperField(this, 3, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.entity.EntityRecord} returns this
 */
proto.spine.server.entity.EntityRecord.prototype.clearVersion = function() {
  return this.setVersion(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.server.entity.EntityRecord.prototype.hasVersion = function() {
  return jspb.Message.getField(this, 3) != null;
};


/**
 * optional LifecycleFlags lifecycle_flags = 4;
 * @return {?proto.spine.server.entity.LifecycleFlags}
 */
proto.spine.server.entity.EntityRecord.prototype.getLifecycleFlags = function() {
  return /** @type{?proto.spine.server.entity.LifecycleFlags} */ (
    jspb.Message.getWrapperField(this, proto.spine.server.entity.LifecycleFlags, 4));
};


/**
 * @param {?proto.spine.server.entity.LifecycleFlags|undefined} value
 * @return {!proto.spine.server.entity.EntityRecord} returns this
*/
proto.spine.server.entity.EntityRecord.prototype.setLifecycleFlags = function(value) {
  return jspb.Message.setWrapperField(this, 4, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.entity.EntityRecord} returns this
 */
proto.spine.server.entity.EntityRecord.prototype.clearLifecycleFlags = function() {
  return this.setLifecycleFlags(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.server.entity.EntityRecord.prototype.hasLifecycleFlags = function() {
  return jspb.Message.getField(this, 4) != null;
};





if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * Optional fields that are not set will be set to undefined.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
 *     JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @return {!Object}
 */
proto.spine.server.entity.LifecycleFlags.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.server.entity.LifecycleFlags.toObject(opt_includeInstance, this);
};


/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
 *     the JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.spine.server.entity.LifecycleFlags} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.entity.LifecycleFlags.toObject = function(includeInstance, msg) {
  var f, obj = {
    archived: jspb.Message.getBooleanFieldWithDefault(msg, 1, false),
    deleted: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}


/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.spine.server.entity.LifecycleFlags}
 */
proto.spine.server.entity.LifecycleFlags.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.server.entity.LifecycleFlags;
  return proto.spine.server.entity.LifecycleFlags.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.server.entity.LifecycleFlags} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.server.entity.LifecycleFlags}
 */
proto.spine.server.entity.LifecycleFlags.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = /** @type {boolean} */ (reader.readBool());
      msg.setArchived(value);
      break;
    case 2:
      var value = /** @type {boolean} */ (reader.readBool());
      msg.setDeleted(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.spine.server.entity.LifecycleFlags.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.spine.server.entity.LifecycleFlags.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.spine.server.entity.LifecycleFlags} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.entity.LifecycleFlags.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getArchived();
  if (f) {
    writer.writeBool(
      1,
      f
    );
  }
  f = message.getDeleted();
  if (f) {
    writer.writeBool(
      2,
      f
    );
  }
};


/**
 * optional bool archived = 1;
 * @return {boolean}
 */
proto.spine.server.entity.LifecycleFlags.prototype.getArchived = function() {
  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false));
};


/**
 * @param {boolean} value
 * @return {!proto.spine.server.entity.LifecycleFlags} returns this
 */
proto.spine.server.entity.LifecycleFlags.prototype.setArchived = function(value) {
  return jspb.Message.setProto3BooleanField(this, 1, value);
};


/**
 * optional bool deleted = 2;
 * @return {boolean}
 */
proto.spine.server.entity.LifecycleFlags.prototype.getDeleted = function() {
  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
};


/**
 * @param {boolean} value
 * @return {!proto.spine.server.entity.LifecycleFlags} returns this
 */
proto.spine.server.entity.LifecycleFlags.prototype.setDeleted = function(value) {
  return jspb.Message.setProto3BooleanField(this, 2, value);
};





if (jspb.Message.GENERATE_TO_OBJECT) {
/**
 * Creates an object representation of this proto.
 * Field names that are reserved in JavaScript and will be renamed to pb_name.
 * Optional fields that are not set will be set to undefined.
 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
 * For the list of reserved names please see:
 *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
 *     JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @return {!Object}
 */
proto.spine.server.entity.EntityRecordChange.prototype.toObject = function(opt_includeInstance) {
  return proto.spine.server.entity.EntityRecordChange.toObject(opt_includeInstance, this);
};


/**
 * Static version of the {@see toObject} method.
 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
 *     the JSPB instance for transitional soy proto support:
 *     http://goto/soy-param-migration
 * @param {!proto.spine.server.entity.EntityRecordChange} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.entity.EntityRecordChange.toObject = function(includeInstance, msg) {
  var f, obj = {
    previousValue: (f = msg.getPreviousValue()) && proto.spine.server.entity.EntityRecord.toObject(includeInstance, f),
    newValue: (f = msg.getNewValue()) && proto.spine.server.entity.EntityRecord.toObject(includeInstance, f)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}


/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.spine.server.entity.EntityRecordChange}
 */
proto.spine.server.entity.EntityRecordChange.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.spine.server.entity.EntityRecordChange;
  return proto.spine.server.entity.EntityRecordChange.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.spine.server.entity.EntityRecordChange} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.spine.server.entity.EntityRecordChange}
 */
proto.spine.server.entity.EntityRecordChange.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new proto.spine.server.entity.EntityRecord;
      reader.readMessage(value,proto.spine.server.entity.EntityRecord.deserializeBinaryFromReader);
      msg.setPreviousValue(value);
      break;
    case 2:
      var value = new proto.spine.server.entity.EntityRecord;
      reader.readMessage(value,proto.spine.server.entity.EntityRecord.deserializeBinaryFromReader);
      msg.setNewValue(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.spine.server.entity.EntityRecordChange.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.spine.server.entity.EntityRecordChange.serializeBinaryToWriter(this, writer);
  return writer.getResultBuffer();
};


/**
 * Serializes the given message to binary data (in protobuf wire
 * format), writing to the given BinaryWriter.
 * @param {!proto.spine.server.entity.EntityRecordChange} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.spine.server.entity.EntityRecordChange.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getPreviousValue();
  if (f != null) {
    writer.writeMessage(
      1,
      f,
      proto.spine.server.entity.EntityRecord.serializeBinaryToWriter
    );
  }
  f = message.getNewValue();
  if (f != null) {
    writer.writeMessage(
      2,
      f,
      proto.spine.server.entity.EntityRecord.serializeBinaryToWriter
    );
  }
};


/**
 * optional EntityRecord previous_value = 1;
 * @return {?proto.spine.server.entity.EntityRecord}
 */
proto.spine.server.entity.EntityRecordChange.prototype.getPreviousValue = function() {
  return /** @type{?proto.spine.server.entity.EntityRecord} */ (
    jspb.Message.getWrapperField(this, proto.spine.server.entity.EntityRecord, 1));
};


/**
 * @param {?proto.spine.server.entity.EntityRecord|undefined} value
 * @return {!proto.spine.server.entity.EntityRecordChange} returns this
*/
proto.spine.server.entity.EntityRecordChange.prototype.setPreviousValue = function(value) {
  return jspb.Message.setWrapperField(this, 1, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.entity.EntityRecordChange} returns this
 */
proto.spine.server.entity.EntityRecordChange.prototype.clearPreviousValue = function() {
  return this.setPreviousValue(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.server.entity.EntityRecordChange.prototype.hasPreviousValue = function() {
  return jspb.Message.getField(this, 1) != null;
};


/**
 * optional EntityRecord new_value = 2;
 * @return {?proto.spine.server.entity.EntityRecord}
 */
proto.spine.server.entity.EntityRecordChange.prototype.getNewValue = function() {
  return /** @type{?proto.spine.server.entity.EntityRecord} */ (
    jspb.Message.getWrapperField(this, proto.spine.server.entity.EntityRecord, 2));
};


/**
 * @param {?proto.spine.server.entity.EntityRecord|undefined} value
 * @return {!proto.spine.server.entity.EntityRecordChange} returns this
*/
proto.spine.server.entity.EntityRecordChange.prototype.setNewValue = function(value) {
  return jspb.Message.setWrapperField(this, 2, value);
};


/**
 * Clears the message field making it undefined.
 * @return {!proto.spine.server.entity.EntityRecordChange} returns this
 */
proto.spine.server.entity.EntityRecordChange.prototype.clearNewValue = function() {
  return this.setNewValue(undefined);
};


/**
 * Returns whether this field is set.
 * @return {boolean}
 */
proto.spine.server.entity.EntityRecordChange.prototype.hasNewValue = function() {
  return jspb.Message.getField(this, 2) != null;
};


/**
 * @enum {number}
 */
proto.spine.server.entity.EntityStateValidationError = {
  UNKNOWN_REASON: 0,
  INVALID_ENTITY_STATE: 1
};

goog.object.extend(exports, proto.spine.server.entity);

// Generated by Spine ProtoJs Plugin

let ObjectParser = require('../../../../client/parser/object-parser.js').default;
let TypeParsers = require('../../../../client/parser/type-parsers.js').default;

proto.spine.server.entity.EntityRecord.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.server.entity.EntityRecord.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.entity.EntityRecord.Parser.prototype.constructor = proto.spine.server.entity.EntityRecord.Parser;
proto.spine.server.entity.EntityRecord.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.server.entity.EntityRecord();
  
  if (obj.entityId !== undefined) {
    if (obj.entityId === null) {
      msg.setEntityId(null);
    } else {
      let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.entityId);
      msg.setEntityId(value);
    }
  }
  
  if (obj.state !== undefined) {
    if (obj.state === null) {
      msg.setState(null);
    } else {
      let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.state);
      msg.setState(value);
    }
  }
  
  if (obj.version !== undefined) {
    if (obj.version === null) {
      msg.setVersion(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.core.Version').fromObject(obj.version);
      msg.setVersion(value);
    }
  }
  
  if (obj.lifecycleFlags !== undefined) {
    if (obj.lifecycleFlags === null) {
      msg.setLifecycleFlags(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.server.entity.LifecycleFlags').fromObject(obj.lifecycleFlags);
      msg.setLifecycleFlags(value);
    }
  }
  return msg;
};

proto.spine.server.entity.LifecycleFlags.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.server.entity.LifecycleFlags.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.entity.LifecycleFlags.Parser.prototype.constructor = proto.spine.server.entity.LifecycleFlags.Parser;
proto.spine.server.entity.LifecycleFlags.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.server.entity.LifecycleFlags();
  
  if (obj.archived !== undefined) {
    if (obj.archived !== null) {
      let value = obj.archived;
      msg.setArchived(value);
    }
  }
  
  if (obj.deleted !== undefined) {
    if (obj.deleted !== null) {
      let value = obj.deleted;
      msg.setDeleted(value);
    }
  }
  return msg;
};

proto.spine.server.entity.EntityRecordChange.Parser = function() {
  ObjectParser.call(this);
};
proto.spine.server.entity.EntityRecordChange.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.server.entity.EntityRecordChange.Parser.prototype.constructor = proto.spine.server.entity.EntityRecordChange.Parser;
proto.spine.server.entity.EntityRecordChange.Parser.prototype.fromObject = function(obj) {
  if (obj === null) {
    return null;
  }
  
  let msg = new proto.spine.server.entity.EntityRecordChange();
  
  if (obj.previousValue !== undefined) {
    if (obj.previousValue === null) {
      msg.setPreviousValue(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.server.entity.EntityRecord').fromObject(obj.previousValue);
      msg.setPreviousValue(value);
    }
  }
  
  if (obj.newValue !== undefined) {
    if (obj.newValue === null) {
      msg.setNewValue(null);
    } else {
      let value = TypeParsers.parserFor('type.spine.io/spine.server.entity.EntityRecord').fromObject(obj.newValue);
      msg.setNewValue(value);
    }
  }
  return msg;
};

// Generated by Spine ProtoJs Plugin
proto.spine.server.entity.EntityRecord.typeUrl = function() {
  return 'type.spine.io/spine.server.entity.EntityRecord';
};

// Generated by Spine ProtoJs Plugin
proto.spine.server.entity.LifecycleFlags.typeUrl = function() {
  return 'type.spine.io/spine.server.entity.LifecycleFlags';
};

// Generated by Spine ProtoJs Plugin
proto.spine.server.entity.EntityRecordChange.typeUrl = function() {
  return 'type.spine.io/spine.server.entity.EntityRecordChange';
};

// Generated by Spine ProtoJs Plugin
proto.spine.server.entity.EntityStateValidationError.typeUrl = function() {
  return 'type.spine.io/spine.server.entity.EntityStateValidationError';
};