// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/protobuf/util/internal/testdata/field_mask.proto

#include <google/protobuf/util/internal/testdata/field_mask.pb.h>

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// This is a temporary google only hack
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)

namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto {
extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2ffield_5fmask_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_FieldMask;
}  // namespace protobuf_google_2fprotobuf_2ffield_5fmask_2eproto
namespace protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto {
extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_FieldMaskWrapper;
extern PROTOBUF_INTERNAL_EXPORT_protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto ::google::protobuf::internal::SCCInfo<1> scc_info_NestedFieldMask;
}  // namespace protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto
namespace google {
namespace protobuf {
namespace testing {
class NestedFieldMaskDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<NestedFieldMask>
      _instance;
} _NestedFieldMask_default_instance_;
class FieldMaskTestDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<FieldMaskTest>
      _instance;
} _FieldMaskTest_default_instance_;
class FieldMaskTestCasesDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<FieldMaskTestCases>
      _instance;
} _FieldMaskTestCases_default_instance_;
class FieldMaskWrapperDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<FieldMaskWrapper>
      _instance;
} _FieldMaskWrapper_default_instance_;
}  // namespace testing
}  // namespace protobuf
}  // namespace google
namespace protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto {
static void InitDefaultsNestedFieldMask() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::google::protobuf::testing::_NestedFieldMask_default_instance_;
    new (ptr) ::google::protobuf::testing::NestedFieldMask();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::google::protobuf::testing::NestedFieldMask::InitAsDefaultInstance();
}

::google::protobuf::internal::SCCInfo<1> scc_info_NestedFieldMask =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsNestedFieldMask}, {
      &protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::scc_info_FieldMask.base,}};

static void InitDefaultsFieldMaskTest() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::google::protobuf::testing::_FieldMaskTest_default_instance_;
    new (ptr) ::google::protobuf::testing::FieldMaskTest();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::google::protobuf::testing::FieldMaskTest::InitAsDefaultInstance();
}

::google::protobuf::internal::SCCInfo<2> scc_info_FieldMaskTest =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsFieldMaskTest}, {
      &protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::scc_info_FieldMask.base,
      &protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_NestedFieldMask.base,}};

static void InitDefaultsFieldMaskTestCases() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::google::protobuf::testing::_FieldMaskTestCases_default_instance_;
    new (ptr) ::google::protobuf::testing::FieldMaskTestCases();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::google::protobuf::testing::FieldMaskTestCases::InitAsDefaultInstance();
}

::google::protobuf::internal::SCCInfo<1> scc_info_FieldMaskTestCases =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsFieldMaskTestCases}, {
      &protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskWrapper.base,}};

static void InitDefaultsFieldMaskWrapper() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::google::protobuf::testing::_FieldMaskWrapper_default_instance_;
    new (ptr) ::google::protobuf::testing::FieldMaskWrapper();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::google::protobuf::testing::FieldMaskWrapper::InitAsDefaultInstance();
}

::google::protobuf::internal::SCCInfo<1> scc_info_FieldMaskWrapper =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsFieldMaskWrapper}, {
      &protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::scc_info_FieldMask.base,}};

void InitDefaults() {
  ::google::protobuf::internal::InitSCC(&scc_info_NestedFieldMask.base);
  ::google::protobuf::internal::InitSCC(&scc_info_FieldMaskTest.base);
  ::google::protobuf::internal::InitSCC(&scc_info_FieldMaskTestCases.base);
  ::google::protobuf::internal::InitSCC(&scc_info_FieldMaskWrapper.base);
}

::google::protobuf::Metadata file_level_metadata[4];

const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::NestedFieldMask, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::NestedFieldMask, data_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::NestedFieldMask, single_mask_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::NestedFieldMask, repeated_mask_),
  ~0u,  // no _has_bits_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTest, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTest, id_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTest, single_mask_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTest, repeated_mask_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTest, nested_mask_),
  ~0u,  // no _has_bits_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, single_mask_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, multiple_mask_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, snake_camel_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, empty_field_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, apiary_format1_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, apiary_format2_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, apiary_format3_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, map_key1_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, map_key2_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, map_key3_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, map_key4_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskTestCases, map_key5_),
  ~0u,  // no _has_bits_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskWrapper, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::google::protobuf::testing::FieldMaskWrapper, mask_),
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, sizeof(::google::protobuf::testing::NestedFieldMask)},
  { 8, -1, sizeof(::google::protobuf::testing::FieldMaskTest)},
  { 17, -1, sizeof(::google::protobuf::testing::FieldMaskTestCases)},
  { 34, -1, sizeof(::google::protobuf::testing::FieldMaskWrapper)},
};

static ::google::protobuf::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::testing::_NestedFieldMask_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::testing::_FieldMaskTest_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::testing::_FieldMaskTestCases_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::google::protobuf::testing::_FieldMaskWrapper_default_instance_),
};

void protobuf_AssignDescriptors() {
  AddDescriptors();
  AssignDescriptors(
      "google/protobuf/util/internal/testdata/field_mask.proto", schemas, file_default_instances, TableStruct::offsets,
      file_level_metadata, NULL, NULL);
}

void protobuf_AssignDescriptorsOnce() {
  static ::google::protobuf::internal::once_flag once;
  ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
}

void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4);
}

void AddDescriptorsImpl() {
  InitDefaults();
  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
      "\n7google/protobuf/util/internal/testdata"
      "/field_mask.proto\022\027google.protobuf.testi"
      "ng\032 google/protobuf/field_mask.proto\"\203\001\n"
      "\017NestedFieldMask\022\014\n\004data\030\001 \001(\t\022/\n\013single"
      "_mask\030\002 \001(\0132\032.google.protobuf.FieldMask\022"
      "1\n\rrepeated_mask\030\003 \003(\0132\032.google.protobuf"
      ".FieldMask\"\276\001\n\rFieldMaskTest\022\n\n\002id\030\001 \001(\t"
      "\022/\n\013single_mask\030\002 \001(\0132\032.google.protobuf."
      "FieldMask\0221\n\rrepeated_mask\030\003 \003(\0132\032.googl"
      "e.protobuf.FieldMask\022=\n\013nested_mask\030\004 \003("
      "\0132(.google.protobuf.testing.NestedFieldM"
      "ask\"\220\006\n\022FieldMaskTestCases\022>\n\013single_mas"
      "k\030\001 \001(\0132).google.protobuf.testing.FieldM"
      "askWrapper\022@\n\rmultiple_mask\030\002 \001(\0132).goog"
      "le.protobuf.testing.FieldMaskWrapper\022>\n\013"
      "snake_camel\030\003 \001(\0132).google.protobuf.test"
      "ing.FieldMaskWrapper\022>\n\013empty_field\030\004 \001("
      "\0132).google.protobuf.testing.FieldMaskWra"
      "pper\022A\n\016apiary_format1\030\005 \001(\0132).google.pr"
      "otobuf.testing.FieldMaskWrapper\022A\n\016apiar"
      "y_format2\030\006 \001(\0132).google.protobuf.testin"
      "g.FieldMaskWrapper\022A\n\016apiary_format3\030\007 \001"
      "(\0132).google.protobuf.testing.FieldMaskWr"
      "apper\022;\n\010map_key1\030\010 \001(\0132).google.protobu"
      "f.testing.FieldMaskWrapper\022;\n\010map_key2\030\t"
      " \001(\0132).google.protobuf.testing.FieldMask"
      "Wrapper\022;\n\010map_key3\030\n \001(\0132).google.proto"
      "buf.testing.FieldMaskWrapper\022;\n\010map_key4"
      "\030\013 \001(\0132).google.protobuf.testing.FieldMa"
      "skWrapper\022;\n\010map_key5\030\014 \001(\0132).google.pro"
      "tobuf.testing.FieldMaskWrapper\"<\n\020FieldM"
      "askWrapper\022(\n\004mask\030\001 \001(\0132\032.google.protob"
      "uf.FieldMask2x\n\024FieldMaskTestService\022`\n\004"
      "Call\022+.google.protobuf.testing.FieldMask"
      "TestCases\032+.google.protobuf.testing.Fiel"
      "dMaskTestCasesb\006proto3"
  };
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
      descriptor, 1422);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "google/protobuf/util/internal/testdata/field_mask.proto", &protobuf_RegisterTypes);
  ::protobuf_google_2fprotobuf_2ffield_5fmask_2eproto::AddDescriptors();
}

void AddDescriptors() {
  static ::google::protobuf::internal::once_flag once;
  ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
  StaticDescriptorInitializer() {
    AddDescriptors();
  }
} static_descriptor_initializer;
}  // namespace protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto
namespace google {
namespace protobuf {
namespace testing {

// ===================================================================

void NestedFieldMask::InitAsDefaultInstance() {
  ::google::protobuf::testing::_NestedFieldMask_default_instance_._instance.get_mutable()->single_mask_ = const_cast< ::google::protobuf::FieldMask*>(
      ::google::protobuf::FieldMask::internal_default_instance());
}
void NestedFieldMask::clear_single_mask() {
  if (GetArenaNoVirtual() == NULL && single_mask_ != NULL) {
    delete single_mask_;
  }
  single_mask_ = NULL;
}
void NestedFieldMask::clear_repeated_mask() {
  repeated_mask_.Clear();
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int NestedFieldMask::kDataFieldNumber;
const int NestedFieldMask::kSingleMaskFieldNumber;
const int NestedFieldMask::kRepeatedMaskFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

NestedFieldMask::NestedFieldMask()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_NestedFieldMask.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:google.protobuf.testing.NestedFieldMask)
}
NestedFieldMask::NestedFieldMask(const NestedFieldMask& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      repeated_mask_(from.repeated_mask_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.data().size() > 0) {
    data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_);
  }
  if (from.has_single_mask()) {
    single_mask_ = new ::google::protobuf::FieldMask(*from.single_mask_);
  } else {
    single_mask_ = NULL;
  }
  // @@protoc_insertion_point(copy_constructor:google.protobuf.testing.NestedFieldMask)
}

void NestedFieldMask::SharedCtor() {
  data_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  single_mask_ = NULL;
}

NestedFieldMask::~NestedFieldMask() {
  // @@protoc_insertion_point(destructor:google.protobuf.testing.NestedFieldMask)
  SharedDtor();
}

void NestedFieldMask::SharedDtor() {
  data_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete single_mask_;
}

void NestedFieldMask::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* NestedFieldMask::descriptor() {
  ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const NestedFieldMask& NestedFieldMask::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_NestedFieldMask.base);
  return *internal_default_instance();
}


void NestedFieldMask::Clear() {
// @@protoc_insertion_point(message_clear_start:google.protobuf.testing.NestedFieldMask)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  repeated_mask_.Clear();
  data_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (GetArenaNoVirtual() == NULL && single_mask_ != NULL) {
    delete single_mask_;
  }
  single_mask_ = NULL;
  _internal_metadata_.Clear();
}

bool NestedFieldMask::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:google.protobuf.testing.NestedFieldMask)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // string data = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_data()));
          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
            this->data().data(), static_cast<int>(this->data().length()),
            ::google::protobuf::internal::WireFormatLite::PARSE,
            "google.protobuf.testing.NestedFieldMask.data"));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.FieldMask single_mask = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_single_mask()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .google.protobuf.FieldMask repeated_mask = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_repeated_mask()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:google.protobuf.testing.NestedFieldMask)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:google.protobuf.testing.NestedFieldMask)
  return false;
#undef DO_
}

void NestedFieldMask::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:google.protobuf.testing.NestedFieldMask)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // string data = 1;
  if (this->data().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
      this->data().data(), static_cast<int>(this->data().length()),
      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
      "google.protobuf.testing.NestedFieldMask.data");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->data(), output);
  }

  // .google.protobuf.FieldMask single_mask = 2;
  if (this->has_single_mask()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2, this->_internal_single_mask(), output);
  }

  // repeated .google.protobuf.FieldMask repeated_mask = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->repeated_mask_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3,
      this->repeated_mask(static_cast<int>(i)),
      output);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
  }
  // @@protoc_insertion_point(serialize_end:google.protobuf.testing.NestedFieldMask)
}

::google::protobuf::uint8* NestedFieldMask::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.testing.NestedFieldMask)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // string data = 1;
  if (this->data().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
      this->data().data(), static_cast<int>(this->data().length()),
      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
      "google.protobuf.testing.NestedFieldMask.data");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->data(), target);
  }

  // .google.protobuf.FieldMask single_mask = 2;
  if (this->has_single_mask()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        2, this->_internal_single_mask(), deterministic, target);
  }

  // repeated .google.protobuf.FieldMask repeated_mask = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->repeated_mask_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        3, this->repeated_mask(static_cast<int>(i)), deterministic, target);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.testing.NestedFieldMask)
  return target;
}

size_t NestedFieldMask::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.protobuf.testing.NestedFieldMask)
  size_t total_size = 0;

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
  }
  // repeated .google.protobuf.FieldMask repeated_mask = 3;
  {
    unsigned int count = static_cast<unsigned int>(this->repeated_mask_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->repeated_mask(static_cast<int>(i)));
    }
  }

  // string data = 1;
  if (this->data().size() > 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::StringSize(
        this->data());
  }

  // .google.protobuf.FieldMask single_mask = 2;
  if (this->has_single_mask()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *single_mask_);
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void NestedFieldMask::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.testing.NestedFieldMask)
  GOOGLE_DCHECK_NE(&from, this);
  const NestedFieldMask* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const NestedFieldMask>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.testing.NestedFieldMask)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.testing.NestedFieldMask)
    MergeFrom(*source);
  }
}

void NestedFieldMask::MergeFrom(const NestedFieldMask& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.testing.NestedFieldMask)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  repeated_mask_.MergeFrom(from.repeated_mask_);
  if (from.data().size() > 0) {

    data_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.data_);
  }
  if (from.has_single_mask()) {
    mutable_single_mask()->::google::protobuf::FieldMask::MergeFrom(from.single_mask());
  }
}

void NestedFieldMask::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.testing.NestedFieldMask)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void NestedFieldMask::CopyFrom(const NestedFieldMask& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.testing.NestedFieldMask)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool NestedFieldMask::IsInitialized() const {
  return true;
}

void NestedFieldMask::Swap(NestedFieldMask* other) {
  if (other == this) return;
  InternalSwap(other);
}
void NestedFieldMask::InternalSwap(NestedFieldMask* other) {
  using std::swap;
  CastToBase(&repeated_mask_)->InternalSwap(CastToBase(&other->repeated_mask_));
  data_.Swap(&other->data_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(single_mask_, other->single_mask_);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata NestedFieldMask::GetMetadata() const {
  protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages];
}


// ===================================================================

void FieldMaskTest::InitAsDefaultInstance() {
  ::google::protobuf::testing::_FieldMaskTest_default_instance_._instance.get_mutable()->single_mask_ = const_cast< ::google::protobuf::FieldMask*>(
      ::google::protobuf::FieldMask::internal_default_instance());
}
void FieldMaskTest::clear_single_mask() {
  if (GetArenaNoVirtual() == NULL && single_mask_ != NULL) {
    delete single_mask_;
  }
  single_mask_ = NULL;
}
void FieldMaskTest::clear_repeated_mask() {
  repeated_mask_.Clear();
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int FieldMaskTest::kIdFieldNumber;
const int FieldMaskTest::kSingleMaskFieldNumber;
const int FieldMaskTest::kRepeatedMaskFieldNumber;
const int FieldMaskTest::kNestedMaskFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

FieldMaskTest::FieldMaskTest()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskTest.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:google.protobuf.testing.FieldMaskTest)
}
FieldMaskTest::FieldMaskTest(const FieldMaskTest& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      repeated_mask_(from.repeated_mask_),
      nested_mask_(from.nested_mask_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.id().size() > 0) {
    id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.id_);
  }
  if (from.has_single_mask()) {
    single_mask_ = new ::google::protobuf::FieldMask(*from.single_mask_);
  } else {
    single_mask_ = NULL;
  }
  // @@protoc_insertion_point(copy_constructor:google.protobuf.testing.FieldMaskTest)
}

void FieldMaskTest::SharedCtor() {
  id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  single_mask_ = NULL;
}

FieldMaskTest::~FieldMaskTest() {
  // @@protoc_insertion_point(destructor:google.protobuf.testing.FieldMaskTest)
  SharedDtor();
}

void FieldMaskTest::SharedDtor() {
  id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete single_mask_;
}

void FieldMaskTest::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* FieldMaskTest::descriptor() {
  ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const FieldMaskTest& FieldMaskTest::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskTest.base);
  return *internal_default_instance();
}


void FieldMaskTest::Clear() {
// @@protoc_insertion_point(message_clear_start:google.protobuf.testing.FieldMaskTest)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  repeated_mask_.Clear();
  nested_mask_.Clear();
  id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (GetArenaNoVirtual() == NULL && single_mask_ != NULL) {
    delete single_mask_;
  }
  single_mask_ = NULL;
  _internal_metadata_.Clear();
}

bool FieldMaskTest::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:google.protobuf.testing.FieldMaskTest)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // string id = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_id()));
          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
            this->id().data(), static_cast<int>(this->id().length()),
            ::google::protobuf::internal::WireFormatLite::PARSE,
            "google.protobuf.testing.FieldMaskTest.id"));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.FieldMask single_mask = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_single_mask()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .google.protobuf.FieldMask repeated_mask = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_repeated_mask()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .google.protobuf.testing.NestedFieldMask nested_mask = 4;
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
                input, add_nested_mask()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:google.protobuf.testing.FieldMaskTest)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:google.protobuf.testing.FieldMaskTest)
  return false;
#undef DO_
}

void FieldMaskTest::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:google.protobuf.testing.FieldMaskTest)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // string id = 1;
  if (this->id().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
      this->id().data(), static_cast<int>(this->id().length()),
      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
      "google.protobuf.testing.FieldMaskTest.id");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->id(), output);
  }

  // .google.protobuf.FieldMask single_mask = 2;
  if (this->has_single_mask()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2, this->_internal_single_mask(), output);
  }

  // repeated .google.protobuf.FieldMask repeated_mask = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->repeated_mask_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3,
      this->repeated_mask(static_cast<int>(i)),
      output);
  }

  // repeated .google.protobuf.testing.NestedFieldMask nested_mask = 4;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->nested_mask_size()); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      4,
      this->nested_mask(static_cast<int>(i)),
      output);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
  }
  // @@protoc_insertion_point(serialize_end:google.protobuf.testing.FieldMaskTest)
}

::google::protobuf::uint8* FieldMaskTest::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.testing.FieldMaskTest)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // string id = 1;
  if (this->id().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
      this->id().data(), static_cast<int>(this->id().length()),
      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
      "google.protobuf.testing.FieldMaskTest.id");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->id(), target);
  }

  // .google.protobuf.FieldMask single_mask = 2;
  if (this->has_single_mask()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        2, this->_internal_single_mask(), deterministic, target);
  }

  // repeated .google.protobuf.FieldMask repeated_mask = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->repeated_mask_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        3, this->repeated_mask(static_cast<int>(i)), deterministic, target);
  }

  // repeated .google.protobuf.testing.NestedFieldMask nested_mask = 4;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->nested_mask_size()); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        4, this->nested_mask(static_cast<int>(i)), deterministic, target);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.testing.FieldMaskTest)
  return target;
}

size_t FieldMaskTest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.protobuf.testing.FieldMaskTest)
  size_t total_size = 0;

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
  }
  // repeated .google.protobuf.FieldMask repeated_mask = 3;
  {
    unsigned int count = static_cast<unsigned int>(this->repeated_mask_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->repeated_mask(static_cast<int>(i)));
    }
  }

  // repeated .google.protobuf.testing.NestedFieldMask nested_mask = 4;
  {
    unsigned int count = static_cast<unsigned int>(this->nested_mask_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          this->nested_mask(static_cast<int>(i)));
    }
  }

  // string id = 1;
  if (this->id().size() > 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::StringSize(
        this->id());
  }

  // .google.protobuf.FieldMask single_mask = 2;
  if (this->has_single_mask()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *single_mask_);
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void FieldMaskTest::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.testing.FieldMaskTest)
  GOOGLE_DCHECK_NE(&from, this);
  const FieldMaskTest* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const FieldMaskTest>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.testing.FieldMaskTest)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.testing.FieldMaskTest)
    MergeFrom(*source);
  }
}

void FieldMaskTest::MergeFrom(const FieldMaskTest& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.testing.FieldMaskTest)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  repeated_mask_.MergeFrom(from.repeated_mask_);
  nested_mask_.MergeFrom(from.nested_mask_);
  if (from.id().size() > 0) {

    id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.id_);
  }
  if (from.has_single_mask()) {
    mutable_single_mask()->::google::protobuf::FieldMask::MergeFrom(from.single_mask());
  }
}

void FieldMaskTest::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.testing.FieldMaskTest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void FieldMaskTest::CopyFrom(const FieldMaskTest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.testing.FieldMaskTest)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool FieldMaskTest::IsInitialized() const {
  return true;
}

void FieldMaskTest::Swap(FieldMaskTest* other) {
  if (other == this) return;
  InternalSwap(other);
}
void FieldMaskTest::InternalSwap(FieldMaskTest* other) {
  using std::swap;
  CastToBase(&repeated_mask_)->InternalSwap(CastToBase(&other->repeated_mask_));
  CastToBase(&nested_mask_)->InternalSwap(CastToBase(&other->nested_mask_));
  id_.Swap(&other->id_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(single_mask_, other->single_mask_);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata FieldMaskTest::GetMetadata() const {
  protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages];
}


// ===================================================================

void FieldMaskTestCases::InitAsDefaultInstance() {
  ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->single_mask_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
      ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->multiple_mask_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
      ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->snake_camel_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
      ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->empty_field_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
      ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->apiary_format1_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
      ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->apiary_format2_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
      ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->apiary_format3_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
      ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->map_key1_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
      ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->map_key2_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
      ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->map_key3_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
      ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->map_key4_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
      ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
  ::google::protobuf::testing::_FieldMaskTestCases_default_instance_._instance.get_mutable()->map_key5_ = const_cast< ::google::protobuf::testing::FieldMaskWrapper*>(
      ::google::protobuf::testing::FieldMaskWrapper::internal_default_instance());
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int FieldMaskTestCases::kSingleMaskFieldNumber;
const int FieldMaskTestCases::kMultipleMaskFieldNumber;
const int FieldMaskTestCases::kSnakeCamelFieldNumber;
const int FieldMaskTestCases::kEmptyFieldFieldNumber;
const int FieldMaskTestCases::kApiaryFormat1FieldNumber;
const int FieldMaskTestCases::kApiaryFormat2FieldNumber;
const int FieldMaskTestCases::kApiaryFormat3FieldNumber;
const int FieldMaskTestCases::kMapKey1FieldNumber;
const int FieldMaskTestCases::kMapKey2FieldNumber;
const int FieldMaskTestCases::kMapKey3FieldNumber;
const int FieldMaskTestCases::kMapKey4FieldNumber;
const int FieldMaskTestCases::kMapKey5FieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

FieldMaskTestCases::FieldMaskTestCases()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskTestCases.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:google.protobuf.testing.FieldMaskTestCases)
}
FieldMaskTestCases::FieldMaskTestCases(const FieldMaskTestCases& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  if (from.has_single_mask()) {
    single_mask_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.single_mask_);
  } else {
    single_mask_ = NULL;
  }
  if (from.has_multiple_mask()) {
    multiple_mask_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.multiple_mask_);
  } else {
    multiple_mask_ = NULL;
  }
  if (from.has_snake_camel()) {
    snake_camel_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.snake_camel_);
  } else {
    snake_camel_ = NULL;
  }
  if (from.has_empty_field()) {
    empty_field_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.empty_field_);
  } else {
    empty_field_ = NULL;
  }
  if (from.has_apiary_format1()) {
    apiary_format1_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.apiary_format1_);
  } else {
    apiary_format1_ = NULL;
  }
  if (from.has_apiary_format2()) {
    apiary_format2_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.apiary_format2_);
  } else {
    apiary_format2_ = NULL;
  }
  if (from.has_apiary_format3()) {
    apiary_format3_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.apiary_format3_);
  } else {
    apiary_format3_ = NULL;
  }
  if (from.has_map_key1()) {
    map_key1_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.map_key1_);
  } else {
    map_key1_ = NULL;
  }
  if (from.has_map_key2()) {
    map_key2_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.map_key2_);
  } else {
    map_key2_ = NULL;
  }
  if (from.has_map_key3()) {
    map_key3_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.map_key3_);
  } else {
    map_key3_ = NULL;
  }
  if (from.has_map_key4()) {
    map_key4_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.map_key4_);
  } else {
    map_key4_ = NULL;
  }
  if (from.has_map_key5()) {
    map_key5_ = new ::google::protobuf::testing::FieldMaskWrapper(*from.map_key5_);
  } else {
    map_key5_ = NULL;
  }
  // @@protoc_insertion_point(copy_constructor:google.protobuf.testing.FieldMaskTestCases)
}

void FieldMaskTestCases::SharedCtor() {
  ::memset(&single_mask_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&map_key5_) -
      reinterpret_cast<char*>(&single_mask_)) + sizeof(map_key5_));
}

FieldMaskTestCases::~FieldMaskTestCases() {
  // @@protoc_insertion_point(destructor:google.protobuf.testing.FieldMaskTestCases)
  SharedDtor();
}

void FieldMaskTestCases::SharedDtor() {
  if (this != internal_default_instance()) delete single_mask_;
  if (this != internal_default_instance()) delete multiple_mask_;
  if (this != internal_default_instance()) delete snake_camel_;
  if (this != internal_default_instance()) delete empty_field_;
  if (this != internal_default_instance()) delete apiary_format1_;
  if (this != internal_default_instance()) delete apiary_format2_;
  if (this != internal_default_instance()) delete apiary_format3_;
  if (this != internal_default_instance()) delete map_key1_;
  if (this != internal_default_instance()) delete map_key2_;
  if (this != internal_default_instance()) delete map_key3_;
  if (this != internal_default_instance()) delete map_key4_;
  if (this != internal_default_instance()) delete map_key5_;
}

void FieldMaskTestCases::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* FieldMaskTestCases::descriptor() {
  ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const FieldMaskTestCases& FieldMaskTestCases::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskTestCases.base);
  return *internal_default_instance();
}


void FieldMaskTestCases::Clear() {
// @@protoc_insertion_point(message_clear_start:google.protobuf.testing.FieldMaskTestCases)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  if (GetArenaNoVirtual() == NULL && single_mask_ != NULL) {
    delete single_mask_;
  }
  single_mask_ = NULL;
  if (GetArenaNoVirtual() == NULL && multiple_mask_ != NULL) {
    delete multiple_mask_;
  }
  multiple_mask_ = NULL;
  if (GetArenaNoVirtual() == NULL && snake_camel_ != NULL) {
    delete snake_camel_;
  }
  snake_camel_ = NULL;
  if (GetArenaNoVirtual() == NULL && empty_field_ != NULL) {
    delete empty_field_;
  }
  empty_field_ = NULL;
  if (GetArenaNoVirtual() == NULL && apiary_format1_ != NULL) {
    delete apiary_format1_;
  }
  apiary_format1_ = NULL;
  if (GetArenaNoVirtual() == NULL && apiary_format2_ != NULL) {
    delete apiary_format2_;
  }
  apiary_format2_ = NULL;
  if (GetArenaNoVirtual() == NULL && apiary_format3_ != NULL) {
    delete apiary_format3_;
  }
  apiary_format3_ = NULL;
  if (GetArenaNoVirtual() == NULL && map_key1_ != NULL) {
    delete map_key1_;
  }
  map_key1_ = NULL;
  if (GetArenaNoVirtual() == NULL && map_key2_ != NULL) {
    delete map_key2_;
  }
  map_key2_ = NULL;
  if (GetArenaNoVirtual() == NULL && map_key3_ != NULL) {
    delete map_key3_;
  }
  map_key3_ = NULL;
  if (GetArenaNoVirtual() == NULL && map_key4_ != NULL) {
    delete map_key4_;
  }
  map_key4_ = NULL;
  if (GetArenaNoVirtual() == NULL && map_key5_ != NULL) {
    delete map_key5_;
  }
  map_key5_ = NULL;
  _internal_metadata_.Clear();
}

bool FieldMaskTestCases::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:google.protobuf.testing.FieldMaskTestCases)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // .google.protobuf.testing.FieldMaskWrapper single_mask = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_single_mask()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.testing.FieldMaskWrapper multiple_mask = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_multiple_mask()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.testing.FieldMaskWrapper snake_camel = 3;
      case 3: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_snake_camel()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.testing.FieldMaskWrapper empty_field = 4;
      case 4: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_empty_field()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.testing.FieldMaskWrapper apiary_format1 = 5;
      case 5: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_apiary_format1()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.testing.FieldMaskWrapper apiary_format2 = 6;
      case 6: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(50u /* 50 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_apiary_format2()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.testing.FieldMaskWrapper apiary_format3 = 7;
      case 7: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(58u /* 58 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_apiary_format3()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.testing.FieldMaskWrapper map_key1 = 8;
      case 8: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(66u /* 66 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_map_key1()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.testing.FieldMaskWrapper map_key2 = 9;
      case 9: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(74u /* 74 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_map_key2()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.testing.FieldMaskWrapper map_key3 = 10;
      case 10: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(82u /* 82 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_map_key3()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.testing.FieldMaskWrapper map_key4 = 11;
      case 11: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_map_key4()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.testing.FieldMaskWrapper map_key5 = 12;
      case 12: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_map_key5()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:google.protobuf.testing.FieldMaskTestCases)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:google.protobuf.testing.FieldMaskTestCases)
  return false;
#undef DO_
}

void FieldMaskTestCases::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:google.protobuf.testing.FieldMaskTestCases)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // .google.protobuf.testing.FieldMaskWrapper single_mask = 1;
  if (this->has_single_mask()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, this->_internal_single_mask(), output);
  }

  // .google.protobuf.testing.FieldMaskWrapper multiple_mask = 2;
  if (this->has_multiple_mask()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2, this->_internal_multiple_mask(), output);
  }

  // .google.protobuf.testing.FieldMaskWrapper snake_camel = 3;
  if (this->has_snake_camel()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3, this->_internal_snake_camel(), output);
  }

  // .google.protobuf.testing.FieldMaskWrapper empty_field = 4;
  if (this->has_empty_field()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      4, this->_internal_empty_field(), output);
  }

  // .google.protobuf.testing.FieldMaskWrapper apiary_format1 = 5;
  if (this->has_apiary_format1()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      5, this->_internal_apiary_format1(), output);
  }

  // .google.protobuf.testing.FieldMaskWrapper apiary_format2 = 6;
  if (this->has_apiary_format2()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      6, this->_internal_apiary_format2(), output);
  }

  // .google.protobuf.testing.FieldMaskWrapper apiary_format3 = 7;
  if (this->has_apiary_format3()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      7, this->_internal_apiary_format3(), output);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key1 = 8;
  if (this->has_map_key1()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      8, this->_internal_map_key1(), output);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key2 = 9;
  if (this->has_map_key2()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      9, this->_internal_map_key2(), output);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key3 = 10;
  if (this->has_map_key3()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      10, this->_internal_map_key3(), output);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key4 = 11;
  if (this->has_map_key4()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      11, this->_internal_map_key4(), output);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key5 = 12;
  if (this->has_map_key5()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      12, this->_internal_map_key5(), output);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
  }
  // @@protoc_insertion_point(serialize_end:google.protobuf.testing.FieldMaskTestCases)
}

::google::protobuf::uint8* FieldMaskTestCases::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.testing.FieldMaskTestCases)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // .google.protobuf.testing.FieldMaskWrapper single_mask = 1;
  if (this->has_single_mask()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        1, this->_internal_single_mask(), deterministic, target);
  }

  // .google.protobuf.testing.FieldMaskWrapper multiple_mask = 2;
  if (this->has_multiple_mask()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        2, this->_internal_multiple_mask(), deterministic, target);
  }

  // .google.protobuf.testing.FieldMaskWrapper snake_camel = 3;
  if (this->has_snake_camel()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        3, this->_internal_snake_camel(), deterministic, target);
  }

  // .google.protobuf.testing.FieldMaskWrapper empty_field = 4;
  if (this->has_empty_field()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        4, this->_internal_empty_field(), deterministic, target);
  }

  // .google.protobuf.testing.FieldMaskWrapper apiary_format1 = 5;
  if (this->has_apiary_format1()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        5, this->_internal_apiary_format1(), deterministic, target);
  }

  // .google.protobuf.testing.FieldMaskWrapper apiary_format2 = 6;
  if (this->has_apiary_format2()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        6, this->_internal_apiary_format2(), deterministic, target);
  }

  // .google.protobuf.testing.FieldMaskWrapper apiary_format3 = 7;
  if (this->has_apiary_format3()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        7, this->_internal_apiary_format3(), deterministic, target);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key1 = 8;
  if (this->has_map_key1()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        8, this->_internal_map_key1(), deterministic, target);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key2 = 9;
  if (this->has_map_key2()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        9, this->_internal_map_key2(), deterministic, target);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key3 = 10;
  if (this->has_map_key3()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        10, this->_internal_map_key3(), deterministic, target);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key4 = 11;
  if (this->has_map_key4()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        11, this->_internal_map_key4(), deterministic, target);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key5 = 12;
  if (this->has_map_key5()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        12, this->_internal_map_key5(), deterministic, target);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.testing.FieldMaskTestCases)
  return target;
}

size_t FieldMaskTestCases::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.protobuf.testing.FieldMaskTestCases)
  size_t total_size = 0;

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
  }
  // .google.protobuf.testing.FieldMaskWrapper single_mask = 1;
  if (this->has_single_mask()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *single_mask_);
  }

  // .google.protobuf.testing.FieldMaskWrapper multiple_mask = 2;
  if (this->has_multiple_mask()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *multiple_mask_);
  }

  // .google.protobuf.testing.FieldMaskWrapper snake_camel = 3;
  if (this->has_snake_camel()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *snake_camel_);
  }

  // .google.protobuf.testing.FieldMaskWrapper empty_field = 4;
  if (this->has_empty_field()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *empty_field_);
  }

  // .google.protobuf.testing.FieldMaskWrapper apiary_format1 = 5;
  if (this->has_apiary_format1()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *apiary_format1_);
  }

  // .google.protobuf.testing.FieldMaskWrapper apiary_format2 = 6;
  if (this->has_apiary_format2()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *apiary_format2_);
  }

  // .google.protobuf.testing.FieldMaskWrapper apiary_format3 = 7;
  if (this->has_apiary_format3()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *apiary_format3_);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key1 = 8;
  if (this->has_map_key1()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *map_key1_);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key2 = 9;
  if (this->has_map_key2()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *map_key2_);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key3 = 10;
  if (this->has_map_key3()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *map_key3_);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key4 = 11;
  if (this->has_map_key4()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *map_key4_);
  }

  // .google.protobuf.testing.FieldMaskWrapper map_key5 = 12;
  if (this->has_map_key5()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *map_key5_);
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void FieldMaskTestCases::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.testing.FieldMaskTestCases)
  GOOGLE_DCHECK_NE(&from, this);
  const FieldMaskTestCases* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const FieldMaskTestCases>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.testing.FieldMaskTestCases)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.testing.FieldMaskTestCases)
    MergeFrom(*source);
  }
}

void FieldMaskTestCases::MergeFrom(const FieldMaskTestCases& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.testing.FieldMaskTestCases)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.has_single_mask()) {
    mutable_single_mask()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.single_mask());
  }
  if (from.has_multiple_mask()) {
    mutable_multiple_mask()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.multiple_mask());
  }
  if (from.has_snake_camel()) {
    mutable_snake_camel()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.snake_camel());
  }
  if (from.has_empty_field()) {
    mutable_empty_field()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.empty_field());
  }
  if (from.has_apiary_format1()) {
    mutable_apiary_format1()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.apiary_format1());
  }
  if (from.has_apiary_format2()) {
    mutable_apiary_format2()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.apiary_format2());
  }
  if (from.has_apiary_format3()) {
    mutable_apiary_format3()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.apiary_format3());
  }
  if (from.has_map_key1()) {
    mutable_map_key1()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.map_key1());
  }
  if (from.has_map_key2()) {
    mutable_map_key2()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.map_key2());
  }
  if (from.has_map_key3()) {
    mutable_map_key3()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.map_key3());
  }
  if (from.has_map_key4()) {
    mutable_map_key4()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.map_key4());
  }
  if (from.has_map_key5()) {
    mutable_map_key5()->::google::protobuf::testing::FieldMaskWrapper::MergeFrom(from.map_key5());
  }
}

void FieldMaskTestCases::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.testing.FieldMaskTestCases)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void FieldMaskTestCases::CopyFrom(const FieldMaskTestCases& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.testing.FieldMaskTestCases)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool FieldMaskTestCases::IsInitialized() const {
  return true;
}

void FieldMaskTestCases::Swap(FieldMaskTestCases* other) {
  if (other == this) return;
  InternalSwap(other);
}
void FieldMaskTestCases::InternalSwap(FieldMaskTestCases* other) {
  using std::swap;
  swap(single_mask_, other->single_mask_);
  swap(multiple_mask_, other->multiple_mask_);
  swap(snake_camel_, other->snake_camel_);
  swap(empty_field_, other->empty_field_);
  swap(apiary_format1_, other->apiary_format1_);
  swap(apiary_format2_, other->apiary_format2_);
  swap(apiary_format3_, other->apiary_format3_);
  swap(map_key1_, other->map_key1_);
  swap(map_key2_, other->map_key2_);
  swap(map_key3_, other->map_key3_);
  swap(map_key4_, other->map_key4_);
  swap(map_key5_, other->map_key5_);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata FieldMaskTestCases::GetMetadata() const {
  protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages];
}


// ===================================================================

void FieldMaskWrapper::InitAsDefaultInstance() {
  ::google::protobuf::testing::_FieldMaskWrapper_default_instance_._instance.get_mutable()->mask_ = const_cast< ::google::protobuf::FieldMask*>(
      ::google::protobuf::FieldMask::internal_default_instance());
}
void FieldMaskWrapper::clear_mask() {
  if (GetArenaNoVirtual() == NULL && mask_ != NULL) {
    delete mask_;
  }
  mask_ = NULL;
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int FieldMaskWrapper::kMaskFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

FieldMaskWrapper::FieldMaskWrapper()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  ::google::protobuf::internal::InitSCC(
      &protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskWrapper.base);
  SharedCtor();
  // @@protoc_insertion_point(constructor:google.protobuf.testing.FieldMaskWrapper)
}
FieldMaskWrapper::FieldMaskWrapper(const FieldMaskWrapper& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  if (from.has_mask()) {
    mask_ = new ::google::protobuf::FieldMask(*from.mask_);
  } else {
    mask_ = NULL;
  }
  // @@protoc_insertion_point(copy_constructor:google.protobuf.testing.FieldMaskWrapper)
}

void FieldMaskWrapper::SharedCtor() {
  mask_ = NULL;
}

FieldMaskWrapper::~FieldMaskWrapper() {
  // @@protoc_insertion_point(destructor:google.protobuf.testing.FieldMaskWrapper)
  SharedDtor();
}

void FieldMaskWrapper::SharedDtor() {
  if (this != internal_default_instance()) delete mask_;
}

void FieldMaskWrapper::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ::google::protobuf::Descriptor* FieldMaskWrapper::descriptor() {
  ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const FieldMaskWrapper& FieldMaskWrapper::default_instance() {
  ::google::protobuf::internal::InitSCC(&protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::scc_info_FieldMaskWrapper.base);
  return *internal_default_instance();
}


void FieldMaskWrapper::Clear() {
// @@protoc_insertion_point(message_clear_start:google.protobuf.testing.FieldMaskWrapper)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  if (GetArenaNoVirtual() == NULL && mask_ != NULL) {
    delete mask_;
  }
  mask_ = NULL;
  _internal_metadata_.Clear();
}

bool FieldMaskWrapper::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:google.protobuf.testing.FieldMaskWrapper)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // .google.protobuf.FieldMask mask = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_mask()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:google.protobuf.testing.FieldMaskWrapper)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:google.protobuf.testing.FieldMaskWrapper)
  return false;
#undef DO_
}

void FieldMaskWrapper::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:google.protobuf.testing.FieldMaskWrapper)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // .google.protobuf.FieldMask mask = 1;
  if (this->has_mask()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, this->_internal_mask(), output);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
  }
  // @@protoc_insertion_point(serialize_end:google.protobuf.testing.FieldMaskWrapper)
}

::google::protobuf::uint8* FieldMaskWrapper::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.testing.FieldMaskWrapper)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // .google.protobuf.FieldMask mask = 1;
  if (this->has_mask()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        1, this->_internal_mask(), deterministic, target);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.testing.FieldMaskWrapper)
  return target;
}

size_t FieldMaskWrapper::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:google.protobuf.testing.FieldMaskWrapper)
  size_t total_size = 0;

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
  }
  // .google.protobuf.FieldMask mask = 1;
  if (this->has_mask()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *mask_);
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void FieldMaskWrapper::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.testing.FieldMaskWrapper)
  GOOGLE_DCHECK_NE(&from, this);
  const FieldMaskWrapper* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const FieldMaskWrapper>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.testing.FieldMaskWrapper)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.testing.FieldMaskWrapper)
    MergeFrom(*source);
  }
}

void FieldMaskWrapper::MergeFrom(const FieldMaskWrapper& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.testing.FieldMaskWrapper)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.has_mask()) {
    mutable_mask()->::google::protobuf::FieldMask::MergeFrom(from.mask());
  }
}

void FieldMaskWrapper::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.testing.FieldMaskWrapper)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void FieldMaskWrapper::CopyFrom(const FieldMaskWrapper& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.testing.FieldMaskWrapper)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool FieldMaskWrapper::IsInitialized() const {
  return true;
}

void FieldMaskWrapper::Swap(FieldMaskWrapper* other) {
  if (other == this) return;
  InternalSwap(other);
}
void FieldMaskWrapper::InternalSwap(FieldMaskWrapper* other) {
  using std::swap;
  swap(mask_, other->mask_);
  _internal_metadata_.Swap(&other->_internal_metadata_);
}

::google::protobuf::Metadata FieldMaskWrapper::GetMetadata() const {
  protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_google_2fprotobuf_2futil_2finternal_2ftestdata_2ffield_5fmask_2eproto::file_level_metadata[kIndexInFileMessages];
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace testing
}  // namespace protobuf
}  // namespace google
namespace google {
namespace protobuf {
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::testing::NestedFieldMask* Arena::CreateMaybeMessage< ::google::protobuf::testing::NestedFieldMask >(Arena* arena) {
  return Arena::CreateInternal< ::google::protobuf::testing::NestedFieldMask >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::testing::FieldMaskTest* Arena::CreateMaybeMessage< ::google::protobuf::testing::FieldMaskTest >(Arena* arena) {
  return Arena::CreateInternal< ::google::protobuf::testing::FieldMaskTest >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::testing::FieldMaskTestCases* Arena::CreateMaybeMessage< ::google::protobuf::testing::FieldMaskTestCases >(Arena* arena) {
  return Arena::CreateInternal< ::google::protobuf::testing::FieldMaskTestCases >(arena);
}
template<> GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::google::protobuf::testing::FieldMaskWrapper* Arena::CreateMaybeMessage< ::google::protobuf::testing::FieldMaskWrapper >(Arena* arena) {
  return Arena::CreateInternal< ::google::protobuf::testing::FieldMaskWrapper >(arena);
}
}  // namespace protobuf
}  // namespace google

// @@protoc_insertion_point(global_scope)
