Defines a key/value pair that can be set or retrieved.
Public Aliases | |
using | base_type = std::pair< key_t, value_t > |
Represents the type of the base. | |
using | key_type = key_t |
Represents the type of the key. | |
using | value_type = value_t |
Representd the type of the value. | |
using | first_type = key_type |
Represents the type of the first. | |
using | second_type = value_type |
Represents the type of the second. | |
Public Properties | |
key_t | first |
Gets or sets the key in the key/value pair. | |
value_t | second |
Gets or sets the value in the key/value pair. | |
const key_t & | key () const noexcept |
Gets the key in the key/value pair. | |
const value_t & | value () const noexcept |
Gets the value in the key/value pair. | |
Public Constructors | |
key_value_pair ()=default | |
Initializes a new instance of the key_value_pair<key_t, value_t> class with the default key and value. | |
key_value_pair (const key_t &key, const value_t &value) | |
Initializes a new instance of the key_value_pair<key_t, value_t> class with the specified key and value. | |
key_value_pair (const std::pair< key_t, value_t > &value) | |
Initializes a new instance of the key_value_pair<key_t, value_t> class with the specified key and value. | |
Public Methods | |
xtd::string | to_string () const noexcept override |
Returns a String representation of the key_value_pair<key_t, value_t>, using the String representations of the key and value. | |
bool | equals (const key_value_pair &value) const noexcept override |
Determines whether the specified object is equal to the current object. | |
bool | equals (const object &obj) const noexcept override |
Determines whether the specified object is equal to the current object. | |
Public Operators | |
operator std::pair< key_t, value_t > () const noexcept | |
Converts the current key_value_pair to a std::pair. | |
Additional Inherited Members | |
Public Member Functions inherited from xtd::object | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
virtual size_t | get_hash_code () const noexcept |
Serves as a hash function for a particular type. | |
virtual type_object | get_type () const noexcept |
Gets the type of the current instance. | |
template<typename object_t > | |
xtd::uptr< object_t > | memberwise_clone () const |
Creates a shallow copy of the current object. | |
Public Member Functions inherited from xtd::iequatable< key_value_pair< key_t, value_t > > | |
virtual bool | equals (const key_value_pair< key_t, value_t > &) const noexcept=0 |
Indicates whether the current object is equal to another object of the same type. | |
Static Public Member Functions inherited from xtd::object | |
template<typename object_a_t , typename object_b_t > | |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
template<typename object_a_t , typename object_b_t > | |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
using xtd::collections::generic::key_value_pair< key_t, value_t >::base_type = std::pair<key_t, value_t> |
Represents the type of the base.
using xtd::collections::generic::key_value_pair< key_t, value_t >::key_type = key_t |
Represents the type of the key.
using xtd::collections::generic::key_value_pair< key_t, value_t >::value_type = value_t |
Representd the type of the value.
using xtd::collections::generic::key_value_pair< key_t, value_t >::first_type = key_type |
Represents the type of the first.
using xtd::collections::generic::key_value_pair< key_t, value_t >::second_type = value_type |
Represents the type of the second.
|
default |
Initializes a new instance of the key_value_pair<key_t, value_t> class with the default key and value.
|
inline |
Initializes a new instance of the key_value_pair<key_t, value_t> class with the specified key and value.
Key | The object defined in each key/value pair |
value | The definition associated with key |
|
inline |
Initializes a new instance of the key_value_pair<key_t, value_t> class with the specified key and value.
value | The key and value of the key_value_pair<key_t, value_t>. |
|
inlinenoexcept |
Gets the key in the key/value pair.
|
inlinenoexcept |
Gets the value in the key/value pair.
|
overridevirtualnoexcept |
Returns a String representation of the key_value_pair<key_t, value_t>, using the String representations of the key and value.
Reimplemented from xtd::object.
|
inlineoverridenoexcept |
Determines whether the specified object is equal to the current object.
value | The key_value_pair to compare with the current object. |
|
inlineoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
obj | The object to compare with the current object. |
Reimplemented from xtd::object.
|
inlinenoexcept |
Converts the current key_value_pair to a std::pair.
key_t xtd::collections::generic::key_value_pair< key_t, value_t >::first |
Gets or sets the key in the key/value pair.
value_t xtd::collections::generic::key_value_pair< key_t, value_t >::second |
Gets or sets the value in the key/value pair.