Summer.Batch.Core.JobParameters Class Reference

Value object representing runtime parameters to a batch job. Because the parameters have no individual meaning outside of the JobParameters they are contained within, it is a value object rather than an entity. It is also extremely important that a parameters object can be reliably compared to another for equality, in order to determine if one JobParameters object equals another. Furthermore, because these parameters will need to be persisted, it is vital that the types added are restricted. This class is immutable and therefore thread-safe. More...

Inheritance diagram for Summer.Batch.Core.JobParameters:

Public Member Functions

 JobParameters ()
 Default constructor. More...
 
 JobParameters (IDictionary< string, JobParameter > parameters)
 Alternative constructor using provided parameters. More...
 
long GetLong (string key)
 Typesafe Getter for the Long represented by the provided key. More...
 
long GetLong (string key, long defaultValue)
 Typesafe Getter for the Long represented by the provided key. If the key does not exist, the default value will be returned. More...
 
string GetString (string key)
 Typesafe Getter for the String represented by the provided key. More...
 
string GetString (string key, string defaultValue)
 Typesafe Getter for the String represented by the provided key. If the key does not exist, the default value will be returned. More...
 
double GetDouble (string key)
 Typesafe Getter for the Long represented by the provided key. More...
 
double GetDouble (string key, double defaultValue)
 Typesafe Getter for the Double represented by the provided key. If the key does not exist, the default value will be returned. More...
 
DateTime GetDate (string key)
 Typesafe Getter for the Date represented by the provided key. More...
 
DateTime GetDate (string key, DateTime?defaultValue)
 Typesafe Getter for the Date represented by the provided key. If the key does not exist, the default value will be returned. More...
 
IDictionary< string, JobParameterGetParameters ()
 Get a dictionary of all parameters, including string, long, and date. More...
 
bool IsEmpty ()
 Test on parameters emptiness. More...
 
override bool Equals (object obj)
 Equals override. More...
 
override int GetHashCode ()
 GetHashCode override. More...
 
override string ToString ()
 ToString override More...
 
NameValueCollection ToProperties ()
 Convert to properties. More...
 
IEnumerator< KeyValuePair< string, JobParameter > > GetEnumerator ()
 Return Enumerator over parameters. More...
 

Detailed Description

Value object representing runtime parameters to a batch job. Because the parameters have no individual meaning outside of the JobParameters they are contained within, it is a value object rather than an entity. It is also extremely important that a parameters object can be reliably compared to another for equality, in order to determine if one JobParameters object equals another. Furthermore, because these parameters will need to be persisted, it is vital that the types added are restricted. This class is immutable and therefore thread-safe.

Constructor & Destructor Documentation

Summer.Batch.Core.JobParameters.JobParameters ( )

Default constructor.

Summer.Batch.Core.JobParameters.JobParameters ( IDictionary< string, JobParameter parameters)

Alternative constructor using provided parameters.

Parameters
parameters

Member Function Documentation

override bool Summer.Batch.Core.JobParameters.Equals ( object  obj)

Equals override.

Parameters
obj
Returns
DateTime Summer.Batch.Core.JobParameters.GetDate ( string  key)

Typesafe Getter for the Date represented by the provided key.

Parameters
keykey The key to get a value for
Returns
the datetime value
DateTime Summer.Batch.Core.JobParameters.GetDate ( string  key,
DateTime?  defaultValue 
)

Typesafe Getter for the Date represented by the provided key. If the key does not exist, the default value will be returned.

Parameters
keykey to return the value for
defaultValuedefaultValue to return if the value doesn't exist
Returns
the parameter represented by the provided key, defaultValue otherwise.
double Summer.Batch.Core.JobParameters.GetDouble ( string  key)

Typesafe Getter for the Long represented by the provided key.

Parameters
keyThe key to get a value for
Returns
the double value
double Summer.Batch.Core.JobParameters.GetDouble ( string  key,
double  defaultValue 
)

Typesafe Getter for the Double represented by the provided key. If the key does not exist, the default value will be returned.

Parameters
keykey to return the value for
defaultValuedefaultValue to return if the value doesn't exist
Returns
the parameter represented by the provided key, defaultValue otherwise
IEnumerator<KeyValuePair<string, JobParameter> > Summer.Batch.Core.JobParameters.GetEnumerator ( )

Return Enumerator over parameters.

Returns
override int Summer.Batch.Core.JobParameters.GetHashCode ( )

GetHashCode override.

Returns
long Summer.Batch.Core.JobParameters.GetLong ( string  key)

Typesafe Getter for the Long represented by the provided key.

Parameters
keyThe key to get a value for
Returns
the long value
long Summer.Batch.Core.JobParameters.GetLong ( string  key,
long  defaultValue 
)

Typesafe Getter for the Long represented by the provided key. If the key does not exist, the default value will be returned.

Parameters
keykey to return the value for
defaultValuedefaultValue to return if the value doesn't exist
Returns
the parameter represented by the provided key, defaultValue otherwise
IDictionary<string, JobParameter> Summer.Batch.Core.JobParameters.GetParameters ( )

Get a dictionary of all parameters, including string, long, and date.

Returns
an unmodifiable dictionary containing all parameters.
string Summer.Batch.Core.JobParameters.GetString ( string  key)

Typesafe Getter for the String represented by the provided key.

Parameters
keyThe key to get a value for
Returns
the string value
string Summer.Batch.Core.JobParameters.GetString ( string  key,
string  defaultValue 
)

Typesafe Getter for the String represented by the provided key. If the key does not exist, the default value will be returned.

Parameters
keykey to return the value for
defaultValuedefaultValue to return if the value doesn't exist
Returns
the parameter represented by the provided key, defaultValue otherwise
bool Summer.Batch.Core.JobParameters.IsEmpty ( )

Test on parameters emptiness.

Returns
true if the parameters is empty, false otherwise
NameValueCollection Summer.Batch.Core.JobParameters.ToProperties ( )

Convert to properties.

Returns
override string Summer.Batch.Core.JobParameters.ToString ( )

ToString override

Returns

The documentation for this class was generated from the following file:
  • Summer.Batch.Core/Core/JobParameters.cs