/** * Tells whether the specified struct field is set or not. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static boolean isSet(TBase<?, ?> struct, TFieldIdEnum field) { return ((TBase) struct).isSet(field); }
@Override protected Object getField(Object record, String name, int pos, Object state) { TFieldIdEnum f = ((TFieldIdEnum[])state)[pos]; TBase struct = (TBase)record; if (struct.isSet(f)) return struct.getFieldValue(f); return null; }
public static Map<String, Object> thriftToMap( org.apache.thrift.TBase thriftObj) { Map<String, Object> ret = new HashMap<>(); int i = 1; TFieldIdEnum field = thriftObj.fieldForId(i); while (field != null) { if (thriftObj.isSet(field)) { Object obj = thriftObj.getFieldValue(field); ret.put(field.getFieldName(), thriftToObject(obj)); } field = thriftObj.fieldForId(++i); } return ret; }
/** * Tells whether the specified struct field is set or not. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static boolean isSet(TBase<?, ?> struct, TFieldIdEnum field) { return ((TBase) struct).isSet(field); }
/** * Tells whether the specified struct field is set or not. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static boolean isSet(TBase<?, ?> struct, TFieldIdEnum field) { return ((TBase) struct).isSet(field); }
/** * Tells whether the specified struct field is set or not. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static boolean isSet(TBase<?, ?> struct, TFieldIdEnum field) { return ((TBase) struct).isSet(field); }
for (Field tField : fieldDesc.getFields()) { if (!thriftObj.isSet((F) tField.getFieldIdEnum()) || (!supportNestedObjects && hasNestedObject(tField))) { fieldId++;