ValidatePathBuilder

Description

sealed class Tinman.Core.Validating.ValidatePathBuilder

Helper class for building ValidatePath objects.

After having created ValidatePathBuilder object with ValidatePath.Build, use the following methods to build a validation path:

Public / Methods

Append

3 overloads


public method Append1 → (1)

path in : ValidatePath

[not-null]
The validation path to append.

returns → ValidatePathBuilder

this

Appends the given validation path.


public method Append2 → (2)

path in : ValidatePath

[not-null]
The validation path to append.

index in : int32

[0..path.Length-1]
Index of the path element to append.

returns → ValidatePathBuilder

this

Appends a path element of the given validation path.


public method Append3 → (1)

path in : ValidatePathBuilder

[not-null]
The validation path to append.

returns → ValidatePathBuilder

this

Appends the given validation path.

Clear


public method Clear → ()

returns → ValidatePathBuilder

this

Removes all path elements from the builder.

Context


public method Context → (1)

context in : object

[not-null]
The context object.

returns → ValidatePathBuilder

this

Adds a path element of type ValidatePathElement.Context.

If the last path element specifies the same context object, this method returns without adding a new path element.

Entry


public method Entry → (1)

name in : string

[not-empty]
The entry name.

returns → ValidatePathBuilder

this

Adds a path element of type ValidatePathElement.Entry.

Index


public method Index → (1)

index in : int32

[>=0]
The element index.

returns → ValidatePathBuilder

this

Adds a path element of type ValidatePathElement.Index.

Member


public method Member → (1)

name in : string

[not-empty]
The member name.

returns → ValidatePathBuilder

this

Adds a path element of type ValidatePathElement.Member.

Path


public method Path → ()

returns → ValidatePath

The built path, which will be ValidatePath.Empty iff Length is zero.

Builds a validation path from the current elements.

Remove


public method Remove → (2)

first in : int32

[0..ValidatePathBuilder.Length]
Index of first path element to remove.

count opt : int32 = 1

[-1..ValidatePathBuilder.Length-first]
Number of path elements to remove. If negative, all remaining elements will be removed.

returns → ValidatePathBuilder

this

Removes elements from the path being built.

Public / Attributes

Length


public attribute Length → (get)

value : int32

[>=0]
The number of path elements.

Returns the length of the path being built, in path elements.