DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Package Functions | Properties | Private Attributes | List of all members
Deveel.Data.Serialization.ObjectData Class Reference

Public Member Functions

bool HasValue (string key)
 
object GetValue (string key)
 
GetValue< T > (string key)
 
bool GetBoolean (string key)
 
byte GetByte (string key)
 
short GetInt16 (string key)
 
int GetInt32 (string key)
 
long GetInt64 (string key)
 
float GetSingle (string key)
 
double GetDouble (string key)
 
string GetString (string key)
 

Package Functions

 ObjectData (Type entityType, IEnumerable< KeyValuePair< string, object >> values)
 

Properties

Type EntityType [get, private set]
 
int Count [get]
 

Private Attributes

readonly Dictionary< string, object > values
 

Detailed Description

Definition at line 22 of file ObjectData.cs.

Constructor & Destructor Documentation

Deveel.Data.Serialization.ObjectData.ObjectData ( Type  entityType,
IEnumerable< KeyValuePair< string, object >>  values 
)
inlinepackage

Definition at line 25 of file ObjectData.cs.

25  {
26  EntityType = entityType;
27  this.values = new Dictionary<string, object>();
28  if (values != null) {
29  foreach (var pair in values) {
30  this.values[pair.Key] = pair.Value;
31  }
32  }
33  }
readonly Dictionary< string, object > values
Definition: ObjectData.cs:23

Member Function Documentation

bool Deveel.Data.Serialization.ObjectData.GetBoolean ( string  key)
inline

Definition at line 73 of file ObjectData.cs.

73  {
74  return GetValue<bool>(key);
75  }
byte Deveel.Data.Serialization.ObjectData.GetByte ( string  key)
inline

Definition at line 77 of file ObjectData.cs.

77  {
78  return GetValue<byte>(key);
79  }
double Deveel.Data.Serialization.ObjectData.GetDouble ( string  key)
inline

Definition at line 97 of file ObjectData.cs.

97  {
98  return GetValue<double>(key);
99  }
short Deveel.Data.Serialization.ObjectData.GetInt16 ( string  key)
inline

Definition at line 81 of file ObjectData.cs.

81  {
82  return GetValue<short>(key);
83  }
int Deveel.Data.Serialization.ObjectData.GetInt32 ( string  key)
inline

Definition at line 85 of file ObjectData.cs.

85  {
86  return GetValue<int>(key);
87  }
long Deveel.Data.Serialization.ObjectData.GetInt64 ( string  key)
inline

Definition at line 89 of file ObjectData.cs.

89  {
90  return GetValue<long>(key);
91  }
float Deveel.Data.Serialization.ObjectData.GetSingle ( string  key)
inline

Definition at line 93 of file ObjectData.cs.

93  {
94  return GetValue<float>(key);
95  }
string Deveel.Data.Serialization.ObjectData.GetString ( string  key)
inline

Definition at line 101 of file ObjectData.cs.

101  {
102  return GetValue<string>(key);
103  }
object Deveel.Data.Serialization.ObjectData.GetValue ( string  key)
inline

Definition at line 48 of file ObjectData.cs.

48  {
49  if (String.IsNullOrEmpty(key))
50  throw new ArgumentNullException("key");
51 
52  object value;
53  if (!values.TryGetValue(key, out value))
54  return null;
55 
56  return value;
57  }
A long string in the system.
readonly Dictionary< string, object > values
Definition: ObjectData.cs:23
T Deveel.Data.Serialization.ObjectData.GetValue< T > ( string  key)
inline

Definition at line 59 of file ObjectData.cs.

59  {
60  var value = GetValue(key);
61  if (value == null)
62  return default(T);
63 
64  if (value is T)
65  return (T) value;
66 
67  if (!(value is IConvertible))
68  throw new InvalidCastException();
69 
70  return (T) Convert.ChangeType(value, typeof (T), CultureInfo.InvariantCulture);
71  }
bool Deveel.Data.Serialization.ObjectData.HasValue ( string  key)
inline

Definition at line 41 of file ObjectData.cs.

41  {
42  if (String.IsNullOrEmpty(key))
43  throw new ArgumentNullException("key");
44 
45  return values.ContainsKey(key);
46  }
A long string in the system.
readonly Dictionary< string, object > values
Definition: ObjectData.cs:23

Member Data Documentation

readonly Dictionary<string, object> Deveel.Data.Serialization.ObjectData.values
private

Definition at line 23 of file ObjectData.cs.

Property Documentation

int Deveel.Data.Serialization.ObjectData.Count
get

Definition at line 37 of file ObjectData.cs.

Type Deveel.Data.Serialization.ObjectData.EntityType
getprivate set

Definition at line 35 of file ObjectData.cs.


The documentation for this class was generated from the following file: