-
Notifications
You must be signed in to change notification settings - Fork 481
/
Copy pathSpecificationProperty.cs
44 lines (36 loc) · 1.28 KB
/
SpecificationProperty.cs
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
// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
using System;
using System.Reflection;
using CSharpx;
namespace CommandLine.Core
{
class SpecificationProperty
{
private readonly Specification specification;
private readonly PropertyInfo property;
private readonly Maybe<object> value;
private SpecificationProperty(Specification specification, PropertyInfo property, Maybe<object> value)
{
this.property = property;
this.specification = specification;
this.value = value;
}
public static SpecificationProperty Create(Specification specification, PropertyInfo property, Maybe<object> value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
return new SpecificationProperty(specification, property, value);
}
public Specification Specification
{
get { return specification; }
}
public PropertyInfo Property
{
get { return property; }
}
public Maybe<object> Value
{
get { return value; }
}
}
}