Class TzdbZone1970Location.Country
A country represented within an entry in the "zone1970.tab" file, with the English name
mapped from the "iso3166.tab" file.
Since 2.0.x
Availability net6.0, net8.0, netstandard2.0
Implements
Inherited Members
Namespace: NodaTime.TimeZones
Assembly: NodaTime.dll
Syntax
public sealed class TzdbZone1970Location.Country : IEquatable<TzdbZone1970Location.Country?>
Remarks
Equality is defined component-wise: two values are considered equal if their country names are equal to each other, and their country codes are equal to each other.
Constructors
Country(string, string)
Constructs a new country from its name and ISO-3166 2-letter code.
Since 2.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public Country(string name, string code)
Parameters
Type | Name | Description |
---|---|---|
string | name | Country name; must not be empty. |
string | code | 2-letter code |
Properties
Code
Gets the ISO-3166 2-letter country code for the country.
Since 2.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public string Code { get; }
Property Value
Type | Description |
---|---|
string | The ISO-3166 2-letter country code for the country. |
Name
Gets the English name of the country.
Since 2.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string | The English name of the country. |
Methods
Equals(Country?)
Compares countries for equality.
See the type documentation for a description of equality semantics.
Since 2.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public bool Equals(TzdbZone1970Location.Country? other)
Parameters
Type | Name | Description |
---|---|---|
TzdbZone1970Location.Country | other | The country to compare with this one. |
Returns
Type | Description |
---|---|
bool | true if the given country has the same name and code as this one; false otherwise. |
Equals(object?)
Compares countries for equality.
See the type documentation for a description of equality semantics.
Since 2.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare this one with. |
Returns
Type | Description |
---|---|
bool | true if the given object is a country with the same name and code as this one; false otherwise. |
Overrides
GetHashCode()
Returns a hash code for this country.
See the type documentation for a description of equality semantics.
Since 2.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this country. |
Overrides
ToString()
Returns a string representation of this country, including the code and name.
Since 2.0.x
Availability net6.0, net8.0, netstandard2.0
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string representation of this country. |