ImmutableObjectBaseT Class

Represents an object that can be configured as read only and thus made immutable. The original contents of this class will not be editable once IsReadOnly is set to true. In order to modify the contest of this object, a clone of the object must be created with CloneEditable.

Definition

Namespace: SnapDB.Immutables
Assembly: SnapDB (in SnapDB.dll) Version: 1.0.102.0 -- Release Build+29075351d0e5aa4dea46a5c520805222f672dc2e
public abstract class ImmutableObjectBase<T> : IImmutableObject<T>, 
	IImmutableObject, ICloneable
where T : ImmutableObjectBase<T>
Inheritance
Object    ImmutableObjectBaseT
Derived
Implements
IImmutableObject, IImmutableObjectT, ICloneable

Type Parameters

T
Object type.

Remarks

For a classes that implement this, all setters should call TestForEditable before setting the value.

Constructors

ImmutableObjectBaseTInitializes a new instance of the ImmutableObjectBaseT class

Properties

IsReadOnly Gets or sets if this class is immutable and thus read-only. Once setting to read-only, the class becomes immutable.

Methods

Clone Creates a clone of the object, either as a read-only instance or an editable one.
CloneEditable Creates a clone of this class that is editable. A clone is always created, even if this class is already editable.
CloneMembersAsEditable Request that member fields be cloned and marked as editable.
CloneReadonly Creates a read-only clone of the object.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
SetMembersAsReadOnly Requests that member fields be set to read-only.
TestForEditable Test if the class has been marked as read-only. Throws an exception if editing cannot occur.
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also