Skip to content

Class TypeRef

Namespace: Apogee.Reflection
Assembly: Apogee.Reflection.dll

The declared type of a property, parameter or result.

public sealed record TypeRef : IEquatable<TypeRef>

Inheritance

object ← TypeRef

Implements

IEquatable<TypeRef>

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

TypeRef(ValueKind, bool, string?, TypeRef?)

The declared type of a property, parameter or result.

public TypeRef(ValueKind Kind, bool Nullable = false, string? Name = null, TypeRef? Element = null)

Parameters

Kind ValueKind

Nullable bool

Name string?

The class or enum name for and .

Element TypeRef?

The element type of a .

Fields

Any

Any value ( itself).

public static readonly TypeRef Any

Field Value

TypeRef

Bool

public static readonly TypeRef Bool

Field Value

TypeRef

Entity

public static readonly TypeRef Entity

Field Value

TypeRef

Float

public static readonly TypeRef Float

Field Value

TypeRef

Function

public static readonly TypeRef Function

Field Value

TypeRef

Int

public static readonly TypeRef Int

Field Value

TypeRef

Quaternion

public static readonly TypeRef Quaternion

Field Value

TypeRef

String

public static readonly TypeRef String

Field Value

TypeRef

Table

public static readonly TypeRef Table

Field Value

TypeRef

Vector3

public static readonly TypeRef Vector3

Field Value

TypeRef

Properties

Element

The element type of a .

public TypeRef? Element { get; init; }

Property Value

TypeRef?

IsAny

public bool IsAny { get; }

Property Value

bool

Kind

public ValueKind Kind { get; init; }

Property Value

ValueKind

Name

The class or enum name for and .

public string? Name { get; init; }

Property Value

string?

Nullable

public bool Nullable { get; init; }

Property Value

bool

Methods

AsNullable()

public TypeRef AsNullable()

Returns

TypeRef

Enum(string, bool)

public static TypeRef Enum(string enumName, bool nullable = false)

Parameters

enumName string

nullable bool

Returns

TypeRef

List(TypeRef, bool)

public static TypeRef List(TypeRef element, bool nullable = false)

Parameters

element TypeRef

nullable bool

Returns

TypeRef

Object(string, bool)

public static TypeRef Object(string className, bool nullable = false)

Parameters

className string

nullable bool

Returns

TypeRef

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.