Repository navigation
Expand file tree
/
Copy pathAsyncAPIString.cs
More file actions
70 lines (62 loc) · 2.21 KB
/
Copy pathAsyncAPIString.cs
File metadata and controls
70 lines (62 loc) · 2.21 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
namespace LEGO.AsyncAPI.Models.Any
{
using LEGO.AsyncAPI.Models.Interfaces;
/// <summary>
/// AsyncApi string type.
/// </summary>
public class AsyncApiString : AsyncApiPrimitive<string>
{
private bool isExplicit;
private bool isRawString;
/// <summary>
/// Initializes the <see cref="AsyncApiString"/> class.
/// </summary>
/// <param name="value"></param>
public AsyncApiString(string value)
: this(value, false)
{
}
/// <summary>
/// Initializes the <see cref="AsyncApiString"/> class.
/// </summary>
/// <param name="value"></param>
/// <param name="isExplicit">Used to indicate if a string is quoted.</param>
public AsyncApiString(string value, bool isExplicit)
: base(value)
{
this.isExplicit = isExplicit;
}
/// <summary>
/// Initializes the <see cref="AsyncApiString"/> class.
/// </summary>
/// <param name="value"></param>
/// <param name="isExplicit">Used to indicate if a string is quoted.</param>
/// <param name="isRawString">Used to indicate to the writer that the value should be written without encoding.</param>
public AsyncApiString(string value, bool isExplicit, bool isRawString)
: base(value)
{
this.isExplicit = isExplicit;
this.isRawString = isRawString;
}
/// <summary>
/// The primitive class this object represents.
/// </summary>
public override PrimitiveType PrimitiveType { get; } = PrimitiveType.String;
/// <summary>
/// True if string was specified explicitly by the means of double quotes, single quotes, or literal or folded style.
/// </summary>
public bool IsExplicit()
{
return this.isExplicit;
}
/// <summary>
/// True if the writer should process the value as supplied without encoding.
/// </summary>
public bool IsRawString()
{
return this.isRawString;
}
}
}