Search Results for

    Show / Hide Table of Contents

    Class HoconValue

    This class represents the root type for a HOCON (Human-Optimized Config Object Notation) configuration object.

    Inheritance
    object
    HoconValue
    Implements
    IMightBeAHoconObject
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Akka.Configuration.Hocon
    Assembly: Akka.dll
    Syntax
    public class HoconValue : IMightBeAHoconObject

    Constructors

    | Edit this page View Source

    HoconValue()

    Initializes a new instance of the HoconValue class.

    Declaration
    public HoconValue()
    | Edit this page View Source

    HoconValue(List<IHoconElement>, bool)

    Initializes a new instance of the HoconValue class.

    Declaration
    public HoconValue(List<IHoconElement> values, bool adoptedFromFallback = true)
    Parameters
    Type Name Description
    List<IHoconElement> values

    The list of elements inside this HOCON value.

    bool adoptedFromFallback

    Indicates whether this instance was constructed during association with fallback Config.

    Properties

    | Edit this page View Source

    IsEmpty

    Returns true if this HOCON value doesn't contain any elements

    Declaration
    public bool IsEmpty { get; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Values

    The list of elements inside this HOCON value

    Declaration
    public List<IHoconElement> Values { get; }
    Property Value
    Type Description
    List<IHoconElement>

    Methods

    | Edit this page View Source

    AppendValue(IHoconElement)

    Adds the given element to the list of elements inside this HoconValue.

    Declaration
    public void AppendValue(IHoconElement value)
    Parameters
    Type Name Description
    IHoconElement value

    The element to add to the list.

    | Edit this page View Source

    AtKey(string)

    Wraps this HoconValue into a new Config object at the specified key.

    Declaration
    public Config AtKey(string key)
    Parameters
    Type Name Description
    string key

    The key designated to be the new root element.

    Returns
    Type Description
    Config

    A Config with the given key as the root element.

    | Edit this page View Source

    Clear()

    Clears the list of elements inside this HoconValue.

    Declaration
    public void Clear()
    | Edit this page View Source

    GetArray()

    Retrieves a list of values from this HoconValue.

    Declaration
    public IList<HoconValue> GetArray()
    Returns
    Type Description
    IList<HoconValue>

    A list of values represented by this HoconValue.

    | Edit this page View Source

    GetBoolean()

    Retrieves the boolean value from this HoconValue.

    Declaration
    public bool GetBoolean()
    Returns
    Type Description
    bool

    The boolean value represented by this HoconValue.

    Exceptions
    Type Condition
    NotSupportedException

    This exception is thrown if the HoconValue doesn't conform to the standard boolean values: "on", "off", "true", or "false"

    | Edit this page View Source

    GetBooleanList()

    Retrieves a list of boolean values from this HoconValue.

    Declaration
    public IList<bool> GetBooleanList()
    Returns
    Type Description
    IList<bool>

    A list of boolean values represented by this HoconValue.

    | Edit this page View Source

    GetByte()

    Retrieves the byte value from this HoconValue.

    Declaration
    public byte GetByte()
    Returns
    Type Description
    byte

    The byte value represented by this HoconValue.

    | Edit this page View Source

    GetByteList()

    Retrieves a list of byte values from this HoconValue.

    Declaration
    public IList<byte> GetByteList()
    Returns
    Type Description
    IList<byte>

    A list of byte values represented by this HoconValue.

    | Edit this page View Source

    GetByteSize()

    Retrieves the long value, optionally suffixed with a case sensitive byte size suffix, from this HoconValue. An empty value results in null.

    Declaration
    public long? GetByteSize()
    Returns
    Type Description
    long?

    The long value represented by this HoconValue.

    | Edit this page View Source

    GetChildObject(string)

    Retrieves the child object located at the given key.

    Declaration
    public HoconValue GetChildObject(string key)
    Parameters
    Type Name Description
    string key

    The key used to retrieve the child object.

    Returns
    Type Description
    HoconValue

    The element at the given key.

    | Edit this page View Source

    GetDecimal()

    Retrieves the decimal value from this HoconValue.

    Declaration
    public decimal GetDecimal()
    Returns
    Type Description
    decimal

    The decimal value represented by this HoconValue.

    | Edit this page View Source

    GetDecimalList()

    Retrieves a list of decimal values from this HoconValue.

    Declaration
    public IList<decimal> GetDecimalList()
    Returns
    Type Description
    IList<decimal>

    A list of decimal values represented by this HoconValue.

    | Edit this page View Source

    GetDouble()

    Retrieves the double value from this HoconValue.

    Declaration
    public double GetDouble()
    Returns
    Type Description
    double

    The double value represented by this HoconValue.

    | Edit this page View Source

    GetDoubleList()

    Retrieves a list of double values from this HoconValue.

    Declaration
    public IList<double> GetDoubleList()
    Returns
    Type Description
    IList<double>

    A list of double values represented by this HoconValue.

    | Edit this page View Source

    GetFloat()

    Retrieves the float value from this HoconValue.

    Declaration
    public float GetFloat()
    Returns
    Type Description
    float

    The float value represented by this HoconValue.

    | Edit this page View Source

    GetFloatList()

    Retrieves a list of float values from this HoconValue.

    Declaration
    public IList<float> GetFloatList()
    Returns
    Type Description
    IList<float>

    A list of float values represented by this HoconValue.

    | Edit this page View Source

    GetInt()

    Retrieves the integer value from this HoconValue.

    Declaration
    public int GetInt()
    Returns
    Type Description
    int

    The integer value represented by this HoconValue.

    | Edit this page View Source

    GetIntList()

    Retrieves a list of integer values from this HoconValue.

    Declaration
    public IList<int> GetIntList()
    Returns
    Type Description
    IList<int>

    A list of integer values represented by this HoconValue.

    | Edit this page View Source

    GetLong()

    Retrieves the long value from this HoconValue.

    Declaration
    public long GetLong()
    Returns
    Type Description
    long

    The long value represented by this HoconValue.

    | Edit this page View Source

    GetLongList()

    Retrieves a list of long values from this HoconValue.

    Declaration
    public IList<long> GetLongList()
    Returns
    Type Description
    IList<long>

    A list of long values represented by this HoconValue.

    | Edit this page View Source

    GetObject()

    Retrieves the HoconObject from this HoconValue.

    Declaration
    public HoconObject GetObject()
    Returns
    Type Description
    HoconObject

    The HoconObject that represents this HoconValue.

    | Edit this page View Source

    GetString()

    Retrieves the string value from this HoconValue.

    Declaration
    public string GetString()
    Returns
    Type Description
    string

    The string value represented by this HoconValue.

    | Edit this page View Source

    GetStringList()

    Retrieves a list of string values from this HoconValue.

    Declaration
    public IList<string> GetStringList()
    Returns
    Type Description
    IList<string>

    A list of string values represented by this HoconValue.

    | Edit this page View Source

    GetTimeSpan(bool)

    Retrieves the time span value from this HoconValue.

    Declaration
    public TimeSpan GetTimeSpan(bool allowInfinite = true)
    Parameters
    Type Name Description
    bool allowInfinite

    A flag used to set infinite durations.

    Returns
    Type Description
    TimeSpan

    The time span value represented by this HoconValue.

    Exceptions
    Type Condition
    FormatException

    This exception is thrown if the timespan given in the HoconValue is negative.

    | Edit this page View Source

    IsArray()

    Determines whether this HoconValue is an array.

    Declaration
    public bool IsArray()
    Returns
    Type Description
    bool

    true if this HoconValue is an array; otherwise false.

    | Edit this page View Source

    IsObject()

    Determines if this HoconValue is a HoconObject.

    Declaration
    public bool IsObject()
    Returns
    Type Description
    bool

    true if this value is a HoconObject, false otherwise.

    | Edit this page View Source

    IsString()

    Determines whether all the elements inside this HoconValue are a string.

    Declaration
    public bool IsString()
    Returns
    Type Description
    bool

    trueif all elements inside this HoconValue are a string; otherwise false.

    | Edit this page View Source

    NewValue(IHoconElement)

    Creates a fresh list of elements inside this HoconValue and adds the given value to the list.

    Declaration
    public void NewValue(IHoconElement value)
    Parameters
    Type Name Description
    IHoconElement value

    The element to add to the list.

    | Edit this page View Source

    ToConfig()

    Declaration
    public Config ToConfig()
    Returns
    Type Description
    Config
    | Edit this page View Source

    ToString()

    Returns a HOCON string representation of this HoconValue.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A HOCON string representation of this HoconValue.

    Overrides
    object.ToString()
    | Edit this page View Source

    ToString(int)

    Returns a HOCON string representation of this HoconValue.

    Declaration
    public virtual string ToString(int indent)
    Parameters
    Type Name Description
    int indent

    The number of spaces to indent the string.

    Returns
    Type Description
    string

    A HOCON string representation of this HoconValue.

    Implements

    IMightBeAHoconObject

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET