blob: aea721de9a94255e81f8ec2c0b096de8a3eb4f52 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Google.Protobuf;
namespace Google.Protobuf.FieldAccess
{
/// <summary>
/// Accessor for repeated fields.
/// </summary>
/// <typeparam name="T">The type of message containing the field.</typeparam>
internal sealed class RepeatedFieldAccessor<T> : FieldAccessorBase<T> where T : IMessage<T>
{
internal RepeatedFieldAccessor(string name) : base(name)
{
}
public override void Clear(T message)
{
IList list = (IList) GetValue(message);
list.Clear();
}
public override bool HasValue(T message)
{
throw new NotImplementedException("HasValue is not implemented for repeated fields");
}
public override void SetValue(T message, object value)
{
throw new NotImplementedException("SetValue is not implemented for repeated fields");
}
}
}
|