// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// This file contains a set of custom features for testing feature resolution of
// arbitrary languages.

// Code generated by protoc-gen-go. DO NOT EDIT.
// source: cmd/protoc-gen-go/testdata/features/test_features.proto

package features

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	descriptorpb "google.golang.org/protobuf/types/descriptorpb"
	reflect "reflect"
	unsafe "unsafe"
)

type EnumFeature int32

const (
	EnumFeature_TEST_ENUM_FEATURE_UNKNOWN EnumFeature = 0
	EnumFeature_VALUE1                    EnumFeature = 1
	EnumFeature_VALUE2                    EnumFeature = 2
	EnumFeature_VALUE3                    EnumFeature = 3
	EnumFeature_VALUE4                    EnumFeature = 4
	EnumFeature_VALUE5                    EnumFeature = 5
)

// Enum value maps for EnumFeature.
var (
	EnumFeature_name = map[int32]string{
		0: "TEST_ENUM_FEATURE_UNKNOWN",
		1: "VALUE1",
		2: "VALUE2",
		3: "VALUE3",
		4: "VALUE4",
		5: "VALUE5",
	}
	EnumFeature_value = map[string]int32{
		"TEST_ENUM_FEATURE_UNKNOWN": 0,
		"VALUE1":                    1,
		"VALUE2":                    2,
		"VALUE3":                    3,
		"VALUE4":                    4,
		"VALUE5":                    5,
	}
)

func (x EnumFeature) Enum() *EnumFeature {
	p := new(EnumFeature)
	*p = x
	return p
}

func (x EnumFeature) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (EnumFeature) Descriptor() protoreflect.EnumDescriptor {
	return file_cmd_protoc_gen_go_testdata_features_test_features_proto_enumTypes[0].Descriptor()
}

func (EnumFeature) Type() protoreflect.EnumType {
	return &file_cmd_protoc_gen_go_testdata_features_test_features_proto_enumTypes[0]
}

func (x EnumFeature) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

type TestFeatures struct {
	state                      protoimpl.MessageState `protogen:"opaque.v1"`
	xxx_hidden_EnumFeature     EnumFeature            `protobuf:"varint,1,opt,name=enum_feature,json=enumFeature,enum=goproto.protoc.features.EnumFeature"`
	xxx_hidden_BoolFeature     bool                   `protobuf:"varint,2,opt,name=bool_feature,json=boolFeature"`
	xxx_hidden_SourceFeature   EnumFeature            `protobuf:"varint,3,opt,name=source_feature,json=sourceFeature,enum=goproto.protoc.features.EnumFeature"`
	xxx_hidden_FixedFeature    EnumFeature            `protobuf:"varint,4,opt,name=fixed_feature,json=fixedFeature,enum=goproto.protoc.features.EnumFeature"`
	xxx_hidden_FutureFeature   EnumFeature            `protobuf:"varint,5,opt,name=future_feature,json=futureFeature,enum=goproto.protoc.features.EnumFeature"`
	xxx_hidden_UnstableFeature EnumFeature            `protobuf:"varint,7,opt,name=unstable_feature,json=unstableFeature,enum=goproto.protoc.features.EnumFeature"`
	XXX_raceDetectHookData     protoimpl.RaceDetectHookData
	XXX_presence               [1]uint32
	unknownFields              protoimpl.UnknownFields
	sizeCache                  protoimpl.SizeCache
}

func (x *TestFeatures) Reset() {
	*x = TestFeatures{}
	mi := &file_cmd_protoc_gen_go_testdata_features_test_features_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *TestFeatures) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*TestFeatures) ProtoMessage() {}

func (x *TestFeatures) ProtoReflect() protoreflect.Message {
	mi := &file_cmd_protoc_gen_go_testdata_features_test_features_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

func (x *TestFeatures) GetEnumFeature() EnumFeature {
	if x != nil {
		if protoimpl.X.Present(&(x.XXX_presence[0]), 0) {
			return x.xxx_hidden_EnumFeature
		}
	}
	return EnumFeature_TEST_ENUM_FEATURE_UNKNOWN
}

func (x *TestFeatures) GetBoolFeature() bool {
	if x != nil {
		return x.xxx_hidden_BoolFeature
	}
	return false
}

func (x *TestFeatures) GetSourceFeature() EnumFeature {
	if x != nil {
		if protoimpl.X.Present(&(x.XXX_presence[0]), 2) {
			return x.xxx_hidden_SourceFeature
		}
	}
	return EnumFeature_TEST_ENUM_FEATURE_UNKNOWN
}

func (x *TestFeatures) GetFixedFeature() EnumFeature {
	if x != nil {
		if protoimpl.X.Present(&(x.XXX_presence[0]), 3) {
			return x.xxx_hidden_FixedFeature
		}
	}
	return EnumFeature_TEST_ENUM_FEATURE_UNKNOWN
}

func (x *TestFeatures) GetFutureFeature() EnumFeature {
	if x != nil {
		if protoimpl.X.Present(&(x.XXX_presence[0]), 4) {
			return x.xxx_hidden_FutureFeature
		}
	}
	return EnumFeature_TEST_ENUM_FEATURE_UNKNOWN
}

func (x *TestFeatures) GetUnstableFeature() EnumFeature {
	if x != nil {
		if protoimpl.X.Present(&(x.XXX_presence[0]), 5) {
			return x.xxx_hidden_UnstableFeature
		}
	}
	return EnumFeature_TEST_ENUM_FEATURE_UNKNOWN
}

func (x *TestFeatures) SetEnumFeature(v EnumFeature) {
	x.xxx_hidden_EnumFeature = v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 6)
}

func (x *TestFeatures) SetBoolFeature(v bool) {
	x.xxx_hidden_BoolFeature = v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 6)
}

func (x *TestFeatures) SetSourceFeature(v EnumFeature) {
	x.xxx_hidden_SourceFeature = v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 6)
}

func (x *TestFeatures) SetFixedFeature(v EnumFeature) {
	x.xxx_hidden_FixedFeature = v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 6)
}

func (x *TestFeatures) SetFutureFeature(v EnumFeature) {
	x.xxx_hidden_FutureFeature = v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 6)
}

func (x *TestFeatures) SetUnstableFeature(v EnumFeature) {
	x.xxx_hidden_UnstableFeature = v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 5, 6)
}

func (x *TestFeatures) HasEnumFeature() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 0)
}

func (x *TestFeatures) HasBoolFeature() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 1)
}

func (x *TestFeatures) HasSourceFeature() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 2)
}

func (x *TestFeatures) HasFixedFeature() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 3)
}

func (x *TestFeatures) HasFutureFeature() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 4)
}

func (x *TestFeatures) HasUnstableFeature() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 5)
}

func (x *TestFeatures) ClearEnumFeature() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)
	x.xxx_hidden_EnumFeature = EnumFeature_TEST_ENUM_FEATURE_UNKNOWN
}

func (x *TestFeatures) ClearBoolFeature() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)
	x.xxx_hidden_BoolFeature = false
}

func (x *TestFeatures) ClearSourceFeature() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)
	x.xxx_hidden_SourceFeature = EnumFeature_TEST_ENUM_FEATURE_UNKNOWN
}

func (x *TestFeatures) ClearFixedFeature() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3)
	x.xxx_hidden_FixedFeature = EnumFeature_TEST_ENUM_FEATURE_UNKNOWN
}

func (x *TestFeatures) ClearFutureFeature() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4)
	x.xxx_hidden_FutureFeature = EnumFeature_TEST_ENUM_FEATURE_UNKNOWN
}

func (x *TestFeatures) ClearUnstableFeature() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 5)
	x.xxx_hidden_UnstableFeature = EnumFeature_TEST_ENUM_FEATURE_UNKNOWN
}

type TestFeatures_builder struct {
	_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.

	EnumFeature     *EnumFeature
	BoolFeature     *bool
	SourceFeature   *EnumFeature
	FixedFeature    *EnumFeature
	FutureFeature   *EnumFeature
	UnstableFeature *EnumFeature
}

func (b0 TestFeatures_builder) Build() *TestFeatures {
	m0 := &TestFeatures{}
	b, x := &b0, m0
	_, _ = b, x
	if b.EnumFeature != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 6)
		x.xxx_hidden_EnumFeature = *b.EnumFeature
	}
	if b.BoolFeature != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 6)
		x.xxx_hidden_BoolFeature = *b.BoolFeature
	}
	if b.SourceFeature != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 6)
		x.xxx_hidden_SourceFeature = *b.SourceFeature
	}
	if b.FixedFeature != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 6)
		x.xxx_hidden_FixedFeature = *b.FixedFeature
	}
	if b.FutureFeature != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 6)
		x.xxx_hidden_FutureFeature = *b.FutureFeature
	}
	if b.UnstableFeature != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 5, 6)
		x.xxx_hidden_UnstableFeature = *b.UnstableFeature
	}
	return m0
}

var file_cmd_protoc_gen_go_testdata_features_test_features_proto_extTypes = []protoimpl.ExtensionInfo{
	{
		ExtendedType:  (*descriptorpb.FeatureSet)(nil),
		ExtensionType: (*TestFeatures)(nil),
		Field:         9999,
		Name:          "goproto.protoc.features.test_features",
		Tag:           "bytes,9999,opt,name=test_features",
		Filename:      "cmd/protoc-gen-go/testdata/features/test_features.proto",
	},
}

// Extension fields to descriptorpb.FeatureSet.
var (
	// optional goproto.protoc.features.TestFeatures test_features = 9999;
	E_TestFeatures = &file_cmd_protoc_gen_go_testdata_features_test_features_proto_extTypes[0]
)

var File_cmd_protoc_gen_go_testdata_features_test_features_proto protoreflect.FileDescriptor

const file_cmd_protoc_gen_go_testdata_features_test_features_proto_rawDesc = "" +
	"\n" +
	"7cmd/protoc-gen-go/testdata/features/test_features.proto\x12\x17goproto.protoc.features\x1a google/protobuf/descriptor.proto\"\x96\x06\n" +
	"\fTestFeatures\x12\x97\x01\n" +
	"\fenum_feature\x18\x01 \x01(\x0e2$.goproto.protoc.features.EnumFeatureBN\x88\x01\x01\x98\x01\x01\x98\x01\x04\x98\x01\x03\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\x98\x01\x05\x98\x01\x02\xa2\x01\v\x12\x06VALUE1\x18\x84\a\xa2\x01\v\x12\x06VALUE2\x18\xe8\a\xa2\x01\v\x12\x06VALUE3\x18\xe9\a\xb2\x01\x03\b\xe8\aR\venumFeature\x12`\n" +
	"\fbool_feature\x18\x02 \x01(\bB=\x88\x01\x01\x98\x01\x01\x98\x01\x04\x98\x01\x03\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\x98\x01\x05\x98\x01\x02\xa2\x01\n" +
	"\x12\x05false\x18\x84\a\xa2\x01\t\x12\x04true\x18\xe8\a\xb2\x01\x03\b\xe8\aR\vboolFeature\x12\x7f\n" +
	"\x0esource_feature\x18\x03 \x01(\x0e2$.goproto.protoc.features.EnumFeatureB2\x88\x01\x02\x98\x01\x01\x98\x01\x04\x98\x01\x03\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\x98\x01\x05\x98\x01\x02\xa2\x01\v\x12\x06VALUE1\x18\x84\a\xb2\x01\x03\b\xe8\aR\rsourceFeature\x12y\n" +
	"\rfixed_feature\x18\x04 \x01(\x0e2$.goproto.protoc.features.EnumFeatureB.\x88\x01\x01\x98\x01\x01\x98\x01\x04\xa2\x01\v\x12\x06VALUE1\x18\x84\a\xa2\x01\v\x12\x06VALUE2\x18\xe8\a\xb2\x01\x06\b\xe8\a \xe8\aR\ffixedFeature\x12x\n" +
	"\x0efuture_feature\x18\x05 \x01(\x0e2$.goproto.protoc.features.EnumFeatureB+\x88\x01\x01\x98\x01\x01\x98\x01\x04\xa2\x01\v\x12\x06VALUE1\x18\x84\a\xa2\x01\v\x12\x06VALUE2\x18\xe9\a\xb2\x01\x03\b\xe9\aR\rfutureFeature\x12\x91\x01\n" +
	"\x10unstable_feature\x18\a \x01(\x0e2$.goproto.protoc.features.EnumFeatureB@\x88\x01\x01\x98\x01\x01\x98\x01\x04\x98\x01\x03\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\x98\x01\x05\x98\x01\x02\xa2\x01\v\x12\x06VALUE1\x18\x84\a\xa2\x01\v\x12\x06VALUE2\x18\x8fN\xb2\x01\x03\b\x8fNR\x0funstableFeatureX\x01*j\n" +
	"\vEnumFeature\x12\x1d\n" +
	"\x19TEST_ENUM_FEATURE_UNKNOWN\x10\x00\x12\n" +
	"\n" +
	"\x06VALUE1\x10\x01\x12\n" +
	"\n" +
	"\x06VALUE2\x10\x02\x12\n" +
	"\n" +
	"\x06VALUE3\x10\x03\x12\n" +
	"\n" +
	"\x06VALUE4\x10\x04\x12\n" +
	"\n" +
	"\x06VALUE5\x10\x050\x01:h\n" +
	"\rtest_features\x12\x1b.google.protobuf.FeatureSet\x18\x8fN \x01(\v2%.goproto.protoc.features.TestFeaturesR\ftestFeaturesB@Z>google.golang.org/protobuf/cmd/protoc-gen-go/testdata/featuresb\beditionsp\xe9\a"

var file_cmd_protoc_gen_go_testdata_features_test_features_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_cmd_protoc_gen_go_testdata_features_test_features_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_cmd_protoc_gen_go_testdata_features_test_features_proto_goTypes = []any{
	(EnumFeature)(0),                // 0: goproto.protoc.features.EnumFeature
	(*TestFeatures)(nil),            // 1: goproto.protoc.features.TestFeatures
	(*descriptorpb.FeatureSet)(nil), // 2: google.protobuf.FeatureSet
}
var file_cmd_protoc_gen_go_testdata_features_test_features_proto_depIdxs = []int32{
	0, // 0: goproto.protoc.features.TestFeatures.enum_feature:type_name -> goproto.protoc.features.EnumFeature
	0, // 1: goproto.protoc.features.TestFeatures.source_feature:type_name -> goproto.protoc.features.EnumFeature
	0, // 2: goproto.protoc.features.TestFeatures.fixed_feature:type_name -> goproto.protoc.features.EnumFeature
	0, // 3: goproto.protoc.features.TestFeatures.future_feature:type_name -> goproto.protoc.features.EnumFeature
	0, // 4: goproto.protoc.features.TestFeatures.unstable_feature:type_name -> goproto.protoc.features.EnumFeature
	2, // 5: goproto.protoc.features.test_features:extendee -> google.protobuf.FeatureSet
	1, // 6: goproto.protoc.features.test_features:type_name -> goproto.protoc.features.TestFeatures
	7, // [7:7] is the sub-list for method output_type
	7, // [7:7] is the sub-list for method input_type
	6, // [6:7] is the sub-list for extension type_name
	5, // [5:6] is the sub-list for extension extendee
	0, // [0:5] is the sub-list for field type_name
}

func init() { file_cmd_protoc_gen_go_testdata_features_test_features_proto_init() }
func file_cmd_protoc_gen_go_testdata_features_test_features_proto_init() {
	if File_cmd_protoc_gen_go_testdata_features_test_features_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_cmd_protoc_gen_go_testdata_features_test_features_proto_rawDesc), len(file_cmd_protoc_gen_go_testdata_features_test_features_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   1,
			NumExtensions: 1,
			NumServices:   0,
		},
		GoTypes:           file_cmd_protoc_gen_go_testdata_features_test_features_proto_goTypes,
		DependencyIndexes: file_cmd_protoc_gen_go_testdata_features_test_features_proto_depIdxs,
		EnumInfos:         file_cmd_protoc_gen_go_testdata_features_test_features_proto_enumTypes,
		MessageInfos:      file_cmd_protoc_gen_go_testdata_features_test_features_proto_msgTypes,
		ExtensionInfos:    file_cmd_protoc_gen_go_testdata_features_test_features_proto_extTypes,
	}.Build()
	File_cmd_protoc_gen_go_testdata_features_test_features_proto = out.File
	file_cmd_protoc_gen_go_testdata_features_test_features_proto_goTypes = nil
	file_cmd_protoc_gen_go_testdata_features_test_features_proto_depIdxs = nil
}
