Pip-Services-Commons-Dotnet
|
Cross-language implementation of dynamic object what can hold value of any type. The stored value can be converted to different types using variety of accessor methods. More...
Public Member Functions | |
AnyValue (object value=null) | |
Creates a new instance of the object and assigns its value. More... | |
AnyValue (AnyValue value) | |
Creates a new instance of the object and assigns its value. More... | |
object | GetAsObject () |
Gets the value stored in this object without any conversions More... | |
void | SetAsObject (object value) |
Sets a new value for this object More... | |
string | GetAsNullableString () |
Converts object value into a string or returns null if conversion is not possible. More... | |
string | GetAsString () |
Converts object value into a string or returns "" if conversion is not possible. More... | |
string | GetAsStringWithDefault (string defaultValue) |
Converts object value into a string or returns default value if conversion is not possible. More... | |
bool | GetAsNullableBoolean () |
Converts object value into a boolean or returns null if conversion is not possible. More... | |
bool | GetAsBoolean () |
Converts object value into a boolean or returns false if conversion is not possible. More... | |
bool | GetAsBooleanWithDefault (bool defaultValue) |
Converts object value into a boolean or returns default value if conversion is not possible. More... | |
int | GetAsNullableInteger () |
Converts object value into an integer or returns null if conversion is not possible. More... | |
int | GetAsInteger () |
onverts object value into an integer or returns 0 if conversion is not possible. More... | |
int | GetAsIntegerWithDefault (int defaultValue) |
Converts object value into a integer or returns default value if conversion is not possible. More... | |
long | GetAsNullableLong () |
Converts object value into a long or returns null if conversion is not possible. More... | |
long | GetAsLong () |
Converts object value into a long or returns 0 if conversion is not possible. More... | |
long | GetAsLongWithDefault (long defaultValue) |
Converts object value into a long or returns default value if conversion is not possible. More... | |
float | GetAsNullableFloat () |
Converts object value into a float or returns null if conversion is not possible. More... | |
float | GetAsFloat () |
Converts object value into a float or returns 0 if conversion is not possible. More... | |
float | GetAsFloatWithDefault (float defaultValue) |
Converts object value into a float or returns default value if conversion is not possible. More... | |
double | GetAsNullableDouble () |
Converts object value into a double or returns null if conversion is not possible. More... | |
double | GetAsDouble () |
Converts object value into a double or returns 0 if conversion is not possible. More... | |
double | GetAsDoubleWithDefault (double defaultValue) |
Converts object value into a double or returns default value if conversion is not possible. More... | |
DateTime | GetAsNullableDateTime () |
Converts object value into a Date or returns null if conversion is not possible. More... | |
DateTime | GetAsDateTime () |
Converts object value into a Date or returns current date if conversion is not possible. More... | |
DateTime | GetAsDateTimeWithDefault (DateTime? defaultValue) |
Converts object value into a Date or returns default value if conversion is not possible. More... | |
TimeSpan | GetAsNullableTimeSpan () |
TimeSpan | GetAsTimeSpan () |
TimeSpan | GetAsTimeSpanWithDefault (TimeSpan? defaultValue) |
T | GetAsNullableEnum< T > () |
T | GetAsEnum< T > () |
T | GetAsEnumWithDefault< T > (T defaultValue) |
T | GetAsNullableType< T > () |
Converts object value into a value defined by specied typecode. If conversion is not possible it returns null. More... | |
T | GetAsType< T > () |
Converts object value into a value defined by specied typecode. If conversion is not possible it returns default value for the specified type. More... | |
T | GetAsTypeWithDefault< T > (T defaultValue) |
Converts object value into a value defined by specied typecode. If conversion is not possible it returns default value. More... | |
AnyValueArray | GetAsArray () |
Converts object value into an AnyArray or returns empty AnyArray if conversion is not possible. More... | |
AnyValueMap | GetAsMap () |
Converts object value into AnyMap or returns empty AnyMap if conversion is not possible. More... | |
override bool | Equals (object obj) |
Compares this object value to specified specified value. When direct comparison gives negative results it tries to compare values as strings. More... | |
bool | EqualsAs< T > (object obj) |
ompares this object value to specified specified value. When direct comparison gives negative results it converts values to type specified by type code and compare them again. More... | |
override string | ToString () |
Gets a string representation of the object. More... | |
override int | GetHashCode () |
Gets an object hash code which can be used to optimize storing and searching. More... | |
object | Clone () |
Creates a binary clone of this object. More... | |
Properties | |
object | Value [get, private set] |
The value stored by this object. More... | |
Cross-language implementation of dynamic object what can hold value of any type. The stored value can be converted to different types using variety of accessor methods.
See StringConverter, BooleanConverter, IntegerConverter, LongConverter, DoubleConverter, FloatConverter, DateTimeConverter, ICloneable
PipServices3.Commons.Data.AnyValue.AnyValue | ( | object | value = null | ) |
Creates a new instance of the object and assigns its value.
value | (optional) value to initialize this object. |
PipServices3.Commons.Data.AnyValue.AnyValue | ( | AnyValue | value | ) |
Creates a new instance of the object and assigns its value.
value | (optional) value to initialize this object. |
object PipServices3.Commons.Data.AnyValue.Clone | ( | ) |
Creates a binary clone of this object.
Implements PipServices3.Commons.Data.ICloneable.
override bool PipServices3.Commons.Data.AnyValue.Equals | ( | object | obj | ) |
Compares this object value to specified specified value. When direct comparison gives negative results it tries to compare values as strings.
obj | the value to be compared with. |
bool PipServices3.Commons.Data.AnyValue.EqualsAs< T > | ( | object | obj | ) |
ompares this object value to specified specified value. When direct comparison gives negative results it converts values to type specified by type code and compare them again.
T | the class type |
obj | the value to be compared with. |
See TypeConverter.ToType<T>(object)
AnyValueArray PipServices3.Commons.Data.AnyValue.GetAsArray | ( | ) |
Converts object value into an AnyArray or returns empty AnyArray if conversion is not possible.
bool PipServices3.Commons.Data.AnyValue.GetAsBoolean | ( | ) |
Converts object value into a boolean or returns false if conversion is not possible.
bool PipServices3.Commons.Data.AnyValue.GetAsBooleanWithDefault | ( | bool | defaultValue | ) |
Converts object value into a boolean or returns default value if conversion is not possible.
defaultValue | the default value |
See BooleanConverter.ToBooleanWithDefault(object, bool)
DateTime PipServices3.Commons.Data.AnyValue.GetAsDateTime | ( | ) |
Converts object value into a Date or returns current date if conversion is not possible.
DateTime PipServices3.Commons.Data.AnyValue.GetAsDateTimeWithDefault | ( | DateTime? | defaultValue | ) |
Converts object value into a Date or returns default value if conversion is not possible.
defaultValue | the default value |
See DateTimeConverter.ToDateTimeWithDefault(object, DateTime?)
double PipServices3.Commons.Data.AnyValue.GetAsDouble | ( | ) |
Converts object value into a double or returns 0 if conversion is not possible.
double PipServices3.Commons.Data.AnyValue.GetAsDoubleWithDefault | ( | double | defaultValue | ) |
Converts object value into a double or returns default value if conversion is not possible.
defaultValue | the default value |
See DoubleConverter.ToDoubleWithDefault(object, double)
float PipServices3.Commons.Data.AnyValue.GetAsFloat | ( | ) |
Converts object value into a float or returns 0 if conversion is not possible.
float PipServices3.Commons.Data.AnyValue.GetAsFloatWithDefault | ( | float | defaultValue | ) |
Converts object value into a float or returns default value if conversion is not possible.
defaultValue | the default value |
See FloatConverter.ToFloatWithDefault(object, float)
int PipServices3.Commons.Data.AnyValue.GetAsInteger | ( | ) |
onverts object value into an integer or returns 0 if conversion is not possible.
int PipServices3.Commons.Data.AnyValue.GetAsIntegerWithDefault | ( | int | defaultValue | ) |
Converts object value into a integer or returns default value if conversion is not possible.
defaultValue | the default value |
long PipServices3.Commons.Data.AnyValue.GetAsLong | ( | ) |
Converts object value into a long or returns 0 if conversion is not possible.
long PipServices3.Commons.Data.AnyValue.GetAsLongWithDefault | ( | long | defaultValue | ) |
Converts object value into a long or returns default value if conversion is not possible.
defaultValue | the default value |
See LongConverter.ToLongWithDefault(object, long)
AnyValueMap PipServices3.Commons.Data.AnyValue.GetAsMap | ( | ) |
Converts object value into AnyMap or returns empty AnyMap if conversion is not possible.
bool PipServices3.Commons.Data.AnyValue.GetAsNullableBoolean | ( | ) |
Converts object value into a boolean or returns null if conversion is not possible.
See BooleanConverter.ToNullableBoolean(object)
DateTime PipServices3.Commons.Data.AnyValue.GetAsNullableDateTime | ( | ) |
Converts object value into a Date or returns null if conversion is not possible.
See DateTimeConverter.ToNullableDateTime(object)
double PipServices3.Commons.Data.AnyValue.GetAsNullableDouble | ( | ) |
Converts object value into a double or returns null if conversion is not possible.
See DoubleConverter.ToNullableDouble(object)
float PipServices3.Commons.Data.AnyValue.GetAsNullableFloat | ( | ) |
Converts object value into a float or returns null if conversion is not possible.
See FloatConverter.ToNullableFloat(object)
int PipServices3.Commons.Data.AnyValue.GetAsNullableInteger | ( | ) |
Converts object value into an integer or returns null if conversion is not possible.
See IntegerConverter.ToNullableInteger(object)
long PipServices3.Commons.Data.AnyValue.GetAsNullableLong | ( | ) |
Converts object value into a long or returns null if conversion is not possible.
See LongConverter.ToNullableLong(object)
string PipServices3.Commons.Data.AnyValue.GetAsNullableString | ( | ) |
Converts object value into a string or returns null if conversion is not possible.
See StringConverter.ToNullableString(object)
T PipServices3.Commons.Data.AnyValue.GetAsNullableType< T > | ( | ) |
Converts object value into a value defined by specied typecode. If conversion is not possible it returns null.
T | the class type |
See TypeConverter.ToNullableType<T>(object)
T | : | struct |
object PipServices3.Commons.Data.AnyValue.GetAsObject | ( | ) |
Gets the value stored in this object without any conversions
string PipServices3.Commons.Data.AnyValue.GetAsString | ( | ) |
Converts object value into a string or returns "" if conversion is not possible.
string PipServices3.Commons.Data.AnyValue.GetAsStringWithDefault | ( | string | defaultValue | ) |
Converts object value into a string or returns default value if conversion is not possible.
defaultValue | the default value. |
See StringConverter.ToStringWithDefault(object, string)
T PipServices3.Commons.Data.AnyValue.GetAsType< T > | ( | ) |
Converts object value into a value defined by specied typecode. If conversion is not possible it returns default value for the specified type.
T | the class type |
See TypeConverter.ToType<T>(object)
T | : | struct |
T PipServices3.Commons.Data.AnyValue.GetAsTypeWithDefault< T > | ( | T | defaultValue | ) |
Converts object value into a value defined by specied typecode. If conversion is not possible it returns default value.
T | the class type |
defaultValue | the default value |
T | : | struct |
override int PipServices3.Commons.Data.AnyValue.GetHashCode | ( | ) |
Gets an object hash code which can be used to optimize storing and searching.
void PipServices3.Commons.Data.AnyValue.SetAsObject | ( | object | value | ) |
Sets a new value for this object
value | the new object value. |
override string PipServices3.Commons.Data.AnyValue.ToString | ( | ) |
Gets a string representation of the object.
See StringConverter.ToString(object)
|
getprivate set |
The value stored by this object.