Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Persistence/3.3/Core/TypeMapping.cs @ 3577

Last change on this file since 3577 was 3016, checked in by epitzer, 14 years ago

Update API docs. (#548)

File size: 1.5 KB
Line 
1using System.Collections.Generic;
2
3namespace HeuristicLab.Persistence.Core {
4
5  /// <summary>
6  /// Association of id, type name and serializer
7  /// </summary>
8  public class TypeMapping {
9
10    /// <summary>
11    /// The type's id.
12    /// </summary>
13    public readonly int Id;
14
15    /// <summary>
16    /// The type's full name.
17    /// </summary>
18    public readonly string TypeName;
19
20
21    /// <summary>
22    /// The full name of the serializes used to serialize the
23    /// <see cref="TypeName"/>.
24    /// </summary>
25    public readonly string Serializer;
26
27    /// <summary>
28    /// Initializes a new instance of the <see cref="TypeMapping"/> class.
29    /// </summary>
30    /// <param name="id">The type's id.</param>
31    /// <param name="typeName">The type's full name.</param>
32    /// <param name="serializer">The full name of the serializer use to
33    /// serialize this type.</param>
34    public TypeMapping(int id, string typeName, string serializer) {
35      Id = id;
36      TypeName = typeName;
37      Serializer = serializer;
38    }
39
40    /// <summary>
41    /// Creates a dictionary that conatins all properties
42    /// and values of this instance.
43    /// </summary>
44    /// <returns>A dictionary containing all properties
45    /// and values of this instance.</returns>
46    public Dictionary<string, object> GetDict() {
47      return new Dictionary<string, object> {
48        {"id", Id},
49        {"typeName", TypeName},
50        {"serializer", Serializer}};
51    }
52
53  }
54
55}
Note: See TracBrowser for help on using the repository browser.