Class LicenseMetadata
Represents the Package LicenseMetadata details. All the relevant warnings and errors should parsed into this model and ideally the readers of this metadata never throw.
public class LicenseMetadata : IEquatable<LicenseMetadata>
- Inheritance
-
LicenseMetadata
- Implements
- Inherited Members
Constructors
LicenseMetadata(LicenseType, string, NuGetLicenseExpression, IReadOnlyList<string>, Version)
public LicenseMetadata(LicenseType type, string license, NuGetLicenseExpression expression, IReadOnlyList<string> warningsAndErrors, Version version)
Parameters
type
LicenseTypelicense
stringexpression
NuGetLicenseExpressionwarningsAndErrors
IReadOnlyList<string>version
Version
Fields
CurrentVersion
public static readonly Version CurrentVersion
Field Value
EmptyVersion
public static readonly Version EmptyVersion
Field Value
LicenseFileDeprecationUrl
public static readonly Uri LicenseFileDeprecationUrl
Field Value
- Uri
LicenseServiceLinkTemplate
public static readonly string LicenseServiceLinkTemplate
Field Value
Properties
License
The license, never null, could be empty.
public string License { get; }
Property Value
LicenseExpression
The license expression, could be null if the version is higher than the current supported or if the expression is not parseable.
public NuGetLicenseExpression LicenseExpression { get; }
Property Value
LicenseUrl
public Uri LicenseUrl { get; }
Property Value
- Uri
Type
The LicenseType, never null
public LicenseType Type { get; }
Property Value
Version
LicenseMetadata (expression) version. Never null.
public Version Version { get; }
Property Value
WarningsAndErrors
Non-null when the expression parsing yielded some issues. This will be used to display the errors/warnings in the UI. Only populated when the metadata element is returned by the nuspec reader;
public IReadOnlyList<string> WarningsAndErrors { get; }
Property Value
Methods
Equals(LicenseMetadata)
public bool Equals(LicenseMetadata other)
Parameters
other
LicenseMetadata
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()