public static bool GetJsonProvidedIndexedPropExists( object @object, FieldInfo field, int index) { var array = GetJsonProvidedSimpleProp(@object, field); return CollectionUtil.ArrayExistsAtIndex((Array) array, index); }
public static bool GetJsonIndexedPropExists( object @object, JsonUnderlyingField field, int index) { var und = (JsonEventObjectBase) @object; if (und.TryGetNativeValue(field.PropertyName, out var value)) { if (value == null) { return false; } if (value is Array array) { return CollectionUtil.ArrayExistsAtIndex(array, index); } throw new InvalidOperationException(MESSAGE_VALUE_NOT_AN_ARRAY); } throw new KeyNotFoundException(field.PropertyName); }
private bool GetBeanPropInternalExists( object @object, int index) { try { var value = (Array) _prop.GetValue(@object); return CollectionUtil.ArrayExistsAtIndex(value, index); } catch (InvalidCastException e) { throw PropertyUtility.GetMismatchException(_prop, @object, e); } catch (TargetException e) { throw PropertyUtility.GetTargetException(_prop, e); } catch (TargetInvocationException e) { throw PropertyUtility.GetTargetException(_prop, e); } catch (MemberAccessException e) { throw PropertyUtility.GetMemberAccessException(_prop, e); } catch (ArgumentException e) { throw PropertyUtility.GetArgumentException(_prop, e); } }
public override bool IsExistsProperty(EventBean eventBean) { var array = BaseNestableEventUtil.CheckedCastUnderlyingObjectArray(eventBean); return CollectionUtil.ArrayExistsAtIndex((Array) array[propertyIndex], index); }
public override bool IsExistsProperty(EventBean eventBean) { var map = BaseNestableEventUtil.CheckedCastUnderlyingMap(eventBean); var array = (Array) map.Get(_propertyMap); return CollectionUtil.ArrayExistsAtIndex(array, _index); }