Class ModelUtils
Helpers shared by the models.
Inheritance
object
ModelUtils
Namespace: Xrpl.Models.Utils
Assembly: Xrpl.dll
Syntax
public static class ModelUtils
Remarks
Called Index until 11.0.0.0 - a calque of the barrel file utils/index.ts it was
ported from, and a name that collides with System.Index, which is in scope in
every file whether anyone asked for it or not. The class now matches the file it has always
lived in.
Methods
| Edit this page View SourceIsFlagEnabled(uint, uint)
Perform bitwise AND (&) to check if a flag is enabled within Flags (as a number).
Declaration
public static bool IsFlagEnabled(this uint Flags, uint checkFlag)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | Flags | A number that represents flags enabled. |
| uint | checkFlag | A specific flag to check if it's enabled within Flags. |
Returns
| Type | Description |
|---|---|
| bool | True if checkFlag is enabled within Flags. |
IsHex(string)
Check if string is in hex format.
Declaration
public static bool IsHex(this string str)
Parameters
| Type | Name | Description |
|---|---|---|
| string | str | The string to check if it's in hex format. |
Returns
| Type | Description |
|---|---|
| bool | True if string is in hex format |
OnlyHasFields(Dictionary<string, object>, string[])
Verify that all fields of an object are in fields.
Declaration
public static bool OnlyHasFields(this Dictionary<string, object> obj, string[] fields)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<string, object> | obj | Object to verify fields. |
| string[] | fields | Fields to verify |
Returns
| Type | Description |
|---|---|
| bool | True if keys in object are all in fields. |