Int32OrStringV1
Record sealed net10.0
Represents a value that can be either a 32-bit integer or a string.
namespace Aspire.Hosting.Kubernetes.Resources;
public sealed record Int32OrStringV1 : System.IEquatable<Aspire.Hosting.Kubernetes.Resources.Int32OrStringV1>, System.IEquatable<int>, System.IEquatable<string>{ // ...} IEquatable<Int32OrStringV1>IEquatable<int>IEquatable<string>
24 members
Remarks
Section titled Remarks This class provides functionality to handle values that could be either an integer or a string. It supports implicit and explicit conversions, equality comparisons, and YAML serialization/deserialization handling.
Constructors3
Section titled ConstructorsInt32OrStringV1(int?, string?) Represents a value that can be either a 32-bit integer or a string.
Int32OrStringV1(int) Initializes a new instance of the
Int32OrStringV1 class with a 32-bit integer value. Int32OrStringV1(string?) Initializes a new instance of the
Int32OrStringV1 class with a string value. Properties3
Section titled PropertiesNumberget; initint?Textget; initstring?Valuegetstring? Gets the string value if the instance represents a string; otherwise, returns the string representation of the 32-bit integer value if the instance represents an integer.
Methods18
Section titled Methods<Clone>$Deconstruct(int?, string?)Equals(int)bool Determines whether the current instance is equal to another integer.
Equals(string?)bool Determines whether the current instance is equal to another string.
Equals(object?)boolDetermines whether the specified object is equal to the current object.
Equals(Int32OrStringV1?)boolIndicates whether the current object is equal to another object of the same type.
GetHashCodeintServes as the default hash function.
op_Equality(Int32OrStringV1?, int)staticbool Compares an instance of Int32OrStringV1 to an integer for equality.
op_Equality(Int32OrStringV1?, string?)staticbool Compares an instance of Int32OrStringV1 to a string for equality.
op_Equality(Int32OrStringV1?, Int32OrStringV1?)staticboolop_Explicit(Int32OrStringV1)staticint Gets the value as a 32-bit integer.
op_Explicit(Int32OrStringV1?)staticstring? Gets the value as a string.
op_Implicit(int)static Gets the integer value as a Int32OrStringV1 instance.
op_Implicit(string?)static Gets the string value as a Int32OrStringV1 instance.
op_Inequality(Int32OrStringV1?, int)staticbool Compares an instance of Int32OrStringV1 to an integer for equality.
op_Inequality(Int32OrStringV1?, string?)staticbool Compares an instance of Int32OrStringV1 to a string for equality.
op_Inequality(Int32OrStringV1?, Int32OrStringV1?)staticboolToStringstring? Returns a string representation of the current instance.