Defines a key/value pair that can be set or retrieved.
Public Aliases | |
| using | base_type |
| Represents the type of the base. | |
| using | key_type |
| Represents the type of the key. | |
| using | value_type |
| Representd the type of the value. | |
| using | first_type |
| Represents the type of the first. | |
| using | second_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. | |
| template<class key_type_t, class value_type_t> | |
| key_value_pair (key_type_t &&key, value_type_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. | |
| key_value_pair (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. | |
| template<class... args1_t, class... args2_t> | |
| key_value_pair (std::piecewise_construct_t, std::tuple< args1_t... > first_args, std::tuple< args2_t... > second_args) | |
| Initializes a new instance of the key_value_pair<key_t, value_t> class with the specified first_args and second_args. | |
Public Methods | |
| bool | equals (const object &obj) const noexcept override |
| Determines whether the specified object is equal to the current object. | |
| bool | equals (const key_value_pair &value) const noexcept override |
| Determines whether the specified object is equal to the current object. | |
| 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. | |
Public Operators | |
| operator std::pair< key_t, value_t > () const noexcept | |
| Converts the current key_value_pair to a std::pair. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual xtd::size | 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<class object_t> | |
| xtd::unique_ptr_object< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object. | |
| 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. | |
| template<class object_a_t, class 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<class object_a_t, class 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 |
Represents the type of the base.
| using xtd::collections::generic::key_value_pair< key_t, value_t >::key_type |
Represents the type of the key.
| using xtd::collections::generic::key_value_pair< key_t, value_t >::value_type |
Representd the type of the value.
| using xtd::collections::generic::key_value_pair< key_t, value_t >::first_type |
Represents the type of the first.
| using xtd::collections::generic::key_value_pair< key_t, value_t >::second_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.
| 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>. |
|
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>. |
|
inline |
Initializes a new instance of the key_value_pair<key_t, value_t> class with the specified first_args and second_args.
| first_args | The tuple of constructor arguments to initialize the first element of this key_value_pair. |
| second_args | The tuple of constructor arguments to initialize the second element of this key_value_pair. |
|
inlinenoexcept |
Gets the key in the key/value pair.
|
inlinenoexcept |
Gets the value in the key/value pair.
|
inlineoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| obj | The object to compare with the current object. |
true if the specified object is equal to the current object; otherwise, false 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. |
true if the specified object is equal to the current object; otherwise, false.
|
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.
|
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.