Example #1
0
 public object Get(
     EventBean eventBean,
     int index)
 {
     var record = (GenericRecord) eventBean.Underlying;
     var values = record.Get(_pos);
     return AvroEventBeanGetterIndexed.GetAvroIndexedValue(values, index);
 }
Example #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>
 /// <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;
 }
Example #3
0
        public object GetFragment(EventBean eventBean)
        {
            var record = (GenericRecord) eventBean.Underlying;
            var values = record.Get(_posTop);
            var value = AvroEventBeanGetterIndexed.GetAvroIndexedValue(values, _index);
            if (value == null || !(value is GenericRecord)) {
                return null;
            }

            return _nested.GetAvroFragment((GenericRecord) value);
        }
        public object Get(EventBean eventBean)
        {
            var record = (GenericRecord) eventBean.Underlying;
            var inner = (GenericRecord) record.Get(_top);
            if (inner == null) {
                return null;
            }

            var collection = inner.Get(_pos);
            return AvroEventBeanGetterIndexed.GetAvroIndexedValue(collection, _index);
        }
Example #5
0
        public static GenericRecord GetAtIndex(
            GenericRecord record,
            string posTop,
            int index)
        {
            var values = record.Get(posTop);
            var value = AvroEventBeanGetterIndexed.GetAvroIndexedValue(values, index);
            if (value == null || !(value is GenericRecord)) {
                return null;
            }

            return (GenericRecord) value;
        }