mirror of
https://github.com/actions/runner.git
synced 2025-12-18 16:26:58 +00:00
GitHub Actions Runner
This commit is contained in:
36
src/Sdk/DTWebApi/WebApi/DemandEquals.cs
Normal file
36
src/Sdk/DTWebApi/WebApi/DemandEquals.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Runtime.Serialization;
|
||||
using GitHub.Services.Common;
|
||||
|
||||
namespace GitHub.DistributedTask.WebApi
|
||||
{
|
||||
[DataContract]
|
||||
public sealed class DemandEquals : Demand
|
||||
{
|
||||
public DemandEquals(
|
||||
String name,
|
||||
String value)
|
||||
: base(name, value)
|
||||
{
|
||||
ArgumentUtility.CheckStringForNullOrEmpty(value, "value");
|
||||
}
|
||||
|
||||
public override Demand Clone()
|
||||
{
|
||||
return new DemandEquals(this.Name, this.Value);
|
||||
}
|
||||
|
||||
protected override String GetExpression()
|
||||
{
|
||||
return String.Format(CultureInfo.InvariantCulture, "{0} -equals {1}", this.Name, this.Value);
|
||||
}
|
||||
|
||||
public override Boolean IsSatisfied(IDictionary<String, String> capabilities)
|
||||
{
|
||||
String value;
|
||||
return capabilities.TryGetValue(this.Name, out value) && this.Value.Equals(value, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user