コード例 #1
0
        internal static void SerializeNumber(NumberProperty number, Dictionary<string, object> fieldDict)
        {
            if (number == null)
                return;

            if (fieldDict == null)
                fieldDict = new Dictionary<string, object>();

            FieldProperty.Serialize(number, fieldDict);
            fieldDict.AddObject(_PRECISION_STEP, number.PrecisionStep, _PRECISION_STEP_DEFAULT);
            fieldDict.AddObject(_DOC_VALUES, number.DocValues, _DOC_VALUES_DEFAULT);
            fieldDict.AddObject(_IGNORE_MALFORMED, number.IgnoreMalformed, _IGNORE_MALFORMED_DEFAULT);
            fieldDict.AddObject(_COERCE, number.Coerce, _COERCE_DEFAULT);
        }
コード例 #2
0
 internal static void DeserializeNumber(NumberProperty number, Dictionary<string, object> fieldDict)
 {
     FieldProperty.Deserialize(number, fieldDict);
     number.PrecisionStep = fieldDict.GetInt32(_PRECISION_STEP, _PRECISION_STEP_DEFAULT);
     number.DocValues = fieldDict.GetBool(_DOC_VALUES, _DOC_VALUES_DEFAULT);
     number.IgnoreMalformed = fieldDict.GetBool(_IGNORE_MALFORMED, _IGNORE_MALFORMED_DEFAULT);
     number.Coerce = fieldDict.GetBool(_COERCE, _COERCE_DEFAULT);
 }