Oracle® Fusion Middleware .NET API Reference for Identity Connector Framework
12c (12.2.1.3.0) E81433-01
|
Encapsulates a read-only bag of properties, which can be accessed in a type-safe manner. More...
Public Member Functions | |
T | GetProperty< T > (string name) |
Gets the value of a required property defined by name in a type-safe manner. More... | |
T | GetProperty< T > (string name, T def) |
Gets a property value, returning a default value when no property with the specified name exists in the bag. More... | |
string | GetStringProperty (string name) |
Gets a required property value known to be of type String. More... | |
Package Functions | |
PropertyBag (IDictionary< string, object > bag) | |
Initializes a new instance of the PropertyBag class with the properties. More... | |
IDictionary< string, object > | ToDictionary () |
Returns a key-value pair collection that represents the current T:PropertyBag. More... | |
Encapsulates a read-only bag of properties, which can be accessed in a type-safe manner.
The simplest way to obtain a required (i.e., the property must be in the bag, otherwise an exception is thrown) property value is PropertyBag.GetProperty{T}(string). If the property is not a required one, the PropertyBag.GetProperty{T}(string, T) method can be used, which also takes a default value which is returned when the property is not present in the bag.
|
package |
Initializes a new instance of the PropertyBag class with the properties.
bag | The properties contained in the bag. |
T Org.IdentityConnectors.Test.Common.PropertyBag.GetProperty< T > | ( | string | name | ) |
Gets the value of a required property defined by name in a type-safe manner.
T | The type of the property to get. |
name | The name of the property. |
null
.ArgumentException | Thrown when no property found defined by name |
InvalidCastException | Thrown when the property exists, but its value is not of type T . |
See PropertyBag.CastValue{T}(string) for details on the types that can be defined in T .
T Org.IdentityConnectors.Test.Common.PropertyBag.GetProperty< T > | ( | string | name, |
T | def | ||
) |
Gets a property value, returning a default value when no property with the specified name exists in the bag.
T | The type of the property to get. |
name | The name of the property. |
def | The default value returned when no property with the specified name exists in the bag. |
null
.InvalidCastException | Thrown when the property exists, but its value is not of type T . |
See PropertyBag.CastValue{T}(string) for details on the types that can be defined in T .
string Org.IdentityConnectors.Test.Common.PropertyBag.GetStringProperty | ( | string | name | ) |
Gets a required property value known to be of type String.
name | The name of the property. |
null
.ArgumentException | Thrown when no property found defined by name |
InvalidCastException | Thrown when the property exists, but its value is not of type String. |
The method expects that the value is an instance of String. It does not attempt to call Object.ToString() on the value.
|
package |
Returns a key-value pair collection that represents the current T:PropertyBag.