#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#endregion
using System;
using System.Collections;
namespace Google.Protobuf.Reflection
{
///
/// Allows fields to be reflectively accessed.
///
public interface IFieldAccessor
{
///
/// Returns the descriptor associated with this field.
///
FieldDescriptor Descriptor { get; }
///
/// Clears the field in the specified message. (For repeated fields,
/// this clears the list.)
///
void Clear(IMessage message);
///
/// Fetches the field value. For repeated values, this will be an
/// implementation. For map values, this will be an
/// implementation.
///
object GetValue(IMessage message);
///
/// Indicates whether the field in the specified message is set.
/// For proto3 fields that aren't explicitly optional, this throws an
///
bool HasValue(IMessage message);
///
/// Mutator for single "simple" fields only.
///
///
/// Repeated fields are mutated by fetching the value and manipulating it as a list.
/// Map fields are mutated by fetching the value and manipulating it as a dictionary.
///
/// The field is not a "simple" field.
void SetValue(IMessage message, object value);
}
}