\r\n

51Degrees Pipeline .NET  4.4

51Degrees Pipeline for .NET

FiftyOne.Pipeline.Engines.Data.AspectPropertyValue< T > Class Template Reference

Detailed Description

This class can be used where engines have a property that may be populated and may not.

See the Specification

Template Parameters
T - The type of data stored within the instance.

Inheritance diagram for FiftyOne.Pipeline.Engines.Data.AspectPropertyValue< T >:

[legend]

Collaboration diagram for FiftyOne.Pipeline.Engines.Data.AspectPropertyValue< T >:

[legend]

Public Member Functions

 AspectPropertyValue ()
Default constructor. More...
 AspectPropertyValue (T value)
Constructor. More...
override string  ToString ()
Get the string representation of this instance. More...
override bool  Equals (object obj)
Check if this instance is equal to the specified object. More...
override int  GetHashCode ()
Get the hash code for this instance. More...

Properties

string  NoValueMessage [get, set]
The message in the Exception if the Value property is accessed and the instance does not have a set value. More...
bool  HasValue [get]
True if this instance contains a value, false otherwise. More...
T  Value [get, set]
Get/set the underlying value. More...

Constructor & Destructor Documentation

Member Function Documentation

◆ Equals()

override bool FiftyOne.Pipeline.Engines.Data.AspectPropertyValue< T >.Equals ( object   obj )

Check if this instance is equal to the specified object.

AspectPropertyValue<T> instances are considered equal they have the same generic type parameter and:

  1. They both have hasValue == false.
  2. They both have Value explicitly set to null.
  3. The Value properties are considered equal.
Parameters
obj - The object to check for equality
Returns
True if this instance is equal to the specified object. False if it is not.

◆ GetHashCode()

override int FiftyOne.Pipeline.Engines.Data.AspectPropertyValue< T >.GetHashCode ( )

Get the hash code for this instance.

If value has been set to null then this will return 0. If HasValue = false then this will return -1. Otherwise, this will return the result of GetHashCode for the stored value.

In order to avoid the most problematic hash collisions, where GetHashCode for the stored value returns 0 or -1 it will be changed to 1 or -2 respectively.

Returns
The hash code for this instance.

◆ ToString()

override string FiftyOne.Pipeline.Engines.Data.AspectPropertyValue< T >.ToString ( )

Get the string representation of this instance.

Returns
The string representation of the value of this instance or 'NULL' if it has explicitly been set to null.
Exceptions
NoValueException - This exception will be thrown if the instance does not contain a value.

Property Documentation