Rev | Line | |
---|
[1454] | 1 | using System.Collections.Generic;
|
---|
| 2 |
|
---|
| 3 | namespace HeuristicLab.Persistence.Core {
|
---|
| 4 |
|
---|
[3004] | 5 | /// <summary>
|
---|
| 6 | /// Association of id, type name and serializer
|
---|
| 7 | /// </summary>
|
---|
[1542] | 8 | public class TypeMapping {
|
---|
[1623] | 9 |
|
---|
[3016] | 10 | /// <summary>
|
---|
| 11 | /// The type's id.
|
---|
| 12 | /// </summary>
|
---|
[1454] | 13 | public readonly int Id;
|
---|
[3016] | 14 |
|
---|
| 15 | /// <summary>
|
---|
| 16 | /// The type's full name.
|
---|
| 17 | /// </summary>
|
---|
[1454] | 18 | public readonly string TypeName;
|
---|
[3016] | 19 |
|
---|
| 20 |
|
---|
| 21 | /// <summary>
|
---|
| 22 | /// The full name of the serializes used to serialize the
|
---|
| 23 | /// <see cref="TypeName"/>.
|
---|
| 24 | /// </summary>
|
---|
[1566] | 25 | public readonly string Serializer;
|
---|
[1623] | 26 |
|
---|
[3016] | 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>
|
---|
[1454] | 34 | public TypeMapping(int id, string typeName, string serializer) {
|
---|
| 35 | Id = id;
|
---|
| 36 | TypeName = typeName;
|
---|
| 37 | Serializer = serializer;
|
---|
| 38 | }
|
---|
[1623] | 39 |
|
---|
[3016] | 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>
|
---|
[1454] | 46 | public Dictionary<string, object> GetDict() {
|
---|
| 47 | return new Dictionary<string, object> {
|
---|
| 48 | {"id", Id},
|
---|
| 49 | {"typeName", TypeName},
|
---|
[1566] | 50 | {"serializer", Serializer}};
|
---|
[1454] | 51 | }
|
---|
[1623] | 52 |
|
---|
[1566] | 53 | }
|
---|
[1454] | 54 |
|
---|
| 55 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.