Exemplo n.º 1
0
 /// <summary>
 ///     NOTE: Code-generation-invoked method, method name and parameter order matters
 /// </summary>
 /// <param name="record">record</param>
 /// <param name="propertyName">property</param>
 /// <param name="index">index</param>
 /// <returns>value</returns>
 public static object GetAvroFieldValue(
     GenericRecord record,
     string propertyName,
     int index)
 {
     var value = record.Get(propertyName);
     return AvroEventBeanGetterIndexed.IsIndexableValue(value)
         ? AvroEventBeanGetterIndexed.GetAvroIndexedValue(value, index)
         : null;
 }
Exemplo n.º 2
0
        /// <summary>
        ///     NOTE: Code-generation-invoked method, method name and parameter order matters
        /// </summary>
        /// <param name="record">record</param>
        /// <param name="propertyName">property</param>
        /// <returns>value</returns>
        public static bool IsAvroFieldExists(
            GenericRecord record,
            string propertyName)
        {
            var field = record.Schema.GetField(propertyName);
            if (field == null) {
                return false;
            }

            var value = record.Get(propertyName);
            return AvroEventBeanGetterIndexed.IsIndexableValue(value);
        }