/// <summary>
        /// Converts specified value into TokenizedPagingParams.
        /// </summary>
        /// <param name="value">value to be converted</param>
        /// <returns>a newly created PagingParams.</returns>
        public static TokenizedPagingParams FromValue(object value)
        {
            if (value is TokenizedPagingParams)
            {
                return((TokenizedPagingParams)value);
            }

            var map = AnyValueMap.FromValue(value);

            return(TokenizedPagingParams.FromMap(map));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Converts specified value into PagingParams.
        /// </summary>
        /// <param name="value">value to be converted</param>
        /// <returns>a newly created PagingParams.</returns>
        public static PagingParams FromValue(object value)
        {
            if (value is PagingParams)
            {
                return((PagingParams)value);
            }

            var map = AnyValueMap.FromValue(value);

            return(FromMap(map));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Converts specified value into FilterParams.
        /// </summary>
        /// <param name="value">value to be converted</param>
        /// <returns>a newly created FilterParams.</returns>
        public new static FilterParams FromValue(object value)
        {
            if (value is FilterParams)
            {
                return((FilterParams)value);
            }

            var map = AnyValueMap.FromValue(value);

            return(new FilterParams(map));
        }
Exemplo n.º 4
0
 /// <summary>
 /// Converts array element into an AnyValueMap or returns empty AnyValueMap if conversion is not possible.
 /// </summary>
 /// <param name="index">an index of element to get.</param>
 /// <returns>AnyValueMap value of the element or empty AnyValueMap if conversion is not supported.</returns>
 /// See <see cref="AnyValueMap"/>
 public AnyValueMap GetAsMap(int index)
 {
     return(AnyValueMap.FromValue(GetAsObject(index)));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Converts array element into an AnyValueMap or returns null if conversion is not possible.
        /// </summary>
        /// <param name="index">an index of element to get.</param>
        /// <returns>AnyValueMap value of the element or null if conversion is not supported.</returns>
        /// See <see cref="AnyValueMap"/>
        public AnyValueMap GetAsNullableMap(int index)
        {
            var value = GetAsObject(index);

            return(value != null?AnyValueMap.FromValue(value) : null);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Converts map element into an AnyValueMap or returns empty AnyValueMap if conversion is not possible.
 /// </summary>
 /// <param name="key">a key of element to get.</param>
 /// <returns>AnyValueMap value of the element or empty AnyValueMap if conversion is not supported.</returns>
 /// See <see cref="FromValue(object)"/>
 public AnyValueMap GetAsMap(string key)
 {
     return(AnyValueMap.FromValue(GetAsObject(key)));
 }
Exemplo n.º 7
0
        /// <summary>
        /// Converts map element into an AnyValueMap or returns null if conversion is not possible.
        /// </summary>
        /// <param name="key">a key of element to get.</param>
        /// <returns>AnyValueMap value of the element or null if conversion is not supported.</returns>
        /// See <see cref="FromValue(object)"/>
        public AnyValueMap GetAsNullableMap(string key)
        {
            var result = GetAsObject(key);

            return(result != null?AnyValueMap.FromValue(result) : null);
        }
Exemplo n.º 8
0
 /// <summary>
 /// Converts object value into AnyMap or returns empty AnyMap if conversion is not possible.
 /// </summary>
 /// <returns>AnyMap value or empty AnyMap if conversion is not supported.</returns>
 /// See <see cref="AnyValueMap.FromValue(object)"/>
 public AnyValueMap GetAsMap()
 {
     return(AnyValueMap.FromValue(Value));
 }