Class ReversibleStringTransform
Represents one reversible transformation from a string to another string.
Inherited Members
Namespace: Eigenverft.NetLib.Infrastructure.Transformations
Assembly: Eigenverft.NetLib.Infrastructure.dll
Syntax
public sealed class ReversibleStringTransform
Remarks
This type is intentionally independent from JSON configuration, persisted wrapper tokens, configuration providers and source switching. A transform owns only the reversible value operation. Callers decide how transformed strings are selected, framed, persisted, published or migrated.
A transform may provide cryptographic protection, machine binding, obfuscation or only a storage representation. Those roles are deliberately distinct. For example, Base64 and Base92 are representations, while ROT13 and Caesar are only analysis-friction layers; none of them is a confidentiality boundary.
TryReverse(string?, out string) is transactional from the caller's perspective. On failure it returns the original transformed value rather than a partially reversed intermediate representation. Composed transforms preserve the same rule.
Constructors
| Edit this page View SourceReversibleStringTransform(string, Func<string, string>, TryReverseDelegate)
Creates a reusable reversible string transform.
Declaration
public ReversibleStringTransform(string name, Func<string, string> apply, ReversibleStringTransform.TryReverseDelegate tryReverse)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | |
| Func<string, string> | apply | |
| ReversibleStringTransform.TryReverseDelegate | tryReverse |
Properties
| Edit this page View SourceName
Gets the descriptive transform name.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceApply(string?)
Applies this transform to one string.
Declaration
public string Apply(string? value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The source value; null is treated as empty. |
Returns
| Type | Description |
|---|---|
| string | The transformed value. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
| Edit this page View SourceTryReverse(string?, out string)
Attempts to reverse this transform for one transformed string.
Declaration
public bool TryReverse(string? transformedValue, out string originalValue)
Parameters
| Type | Name | Description |
|---|---|---|
| string | transformedValue | The transformed value; null is treated as empty. |
| string | originalValue | Receives the original value on success. On failure, receives |
Returns
| Type | Description |
|---|---|
| bool | true when the complete transform reverses successfully; otherwise false. |