Allows you to lookup objects from an array by e.g. their id.
@param fieldName field to match on
@param value value of the field
@return the first object where field == value, or null
343849
public Optional<JsonObject> findFirstWithFieldValue(@Nonnull String fieldName, String value) {
        JsonElement result = findFirstMatching(e -> {
            if(!e.isObject()) {
                return false;
            }
            JsonObject object = e.asObject();
            String fieldValue = object.getString(fieldName);
            if(fieldValue !=null) {
                return fieldValue.equals(value);
            } else {
                return false;
            }
        }).orElse(null);
        if(result != null) {
            return Optional.of(result.asObject());
        } else {
            return Optional.empty();
        }
    }
182462
public void addValueToField(String fieldName, Object value) {
		add(new SimpleUpdateField(fieldName, value, UpdateAction.ADD));
	}
528893
public static Field getField(Class clazz, String fieldName)
    {
        try
        {
            return clazz.getField(fieldName);
        }
        catch (Exception ignored)
        {}
        return null;
    }
15563
public static Object getFieldValue(Object object, String fieldName) {
        try {
            return getDeclaredFieldInHierarchy(object.getClass(), fieldName).get(object);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
293196
public static ResourceField getInstance(int value)
   {
      ResourceField result = null;

      if (value >= 0 && value < FIELD_ARRAY.length)
      {
         result = FIELD_ARRAY[value];
      }
      else
      {
         if ((value & 0x8000) != 0)
         {
            int baseValue = ResourceField.ENTERPRISE_CUSTOM_FIELD1.getValue();
            int id = baseValue + (value & 0xFFF);
            result = ResourceField.getInstance(id);
         }
      }

      return (result);
   }
643437
public static Object getFieldValue(Object obj, String name) {
        Class<?> clazz = obj.getClass();
        try {
            Field f = clazz.getDeclaredField(name);
            return f.get(obj);
        }
        catch (Exception e) {
            return null;
        }
    }
172419
public void setInt(String fieldName, Integer value) {
		if (value == null) {
			throw new IllegalArgumentException("参数值[" + fieldName + "]不能为NULL.");
		}
		fieldList.add(fieldName);
		statementParameter.setInt(value);
	}
994316
public String getValue(final String field)
    {
        FieldValue fieldValue = Iterables.find
        (
            fieldValues,
            new Predicate<FieldValue>()
            {
                @Override
                public boolean apply(FieldValue fv)
                {
                    return fv.getField().equals(field);
                }
            },
            null
        );
        return (fieldValue != null) ? fieldValue.getValue() : null;
    }
167136
public IDocumentQuery<T> whereLessThan(String fieldName, Object value) {
        return whereLessThan(fieldName, value, false);
    }
1049492
public String getString(String fieldName) {
		return hasValue(fieldName) ? String.valueOf(resultMap.get(fieldName)) : null;
	}
701817
public FieldValue lookup(FieldName name){
		Map<FieldName, FieldValue> values = getValues();

		FieldValue value = values.getOrDefault(name, EvaluationContext.UNDECLARED_VALUE);
		if(value != EvaluationContext.UNDECLARED_VALUE){
			return value;
		}

		throw new MissingValueException(name);
	}
1209115
protected final Object beanLookup(Object value, Object propertyName) {
        LOGGER.trace("get JavaBean property : " + propertyName);
        return ParseUtils.getProperty(value, propertyName.toString(), PROPERTY_CACHE);
    }
987879
public static Field getField(String fieldName, Object object) {
    return getField(fieldName, object.getClass());
  }
949928
static Object getAdditionalFieldValue(String value, String fieldType) {

        Object result = null;
        if (fieldType.equalsIgnoreCase(FIELD_TYPE_DISCOVER)) {

            Result discoveredType = ValueDiscovery.discover(value);

            if (discoveredType == Result.STRING) {
                return value;
            }

            if (discoveredType == Result.LONG) {
                try {
                    // try adding the value as a long
                    return Long.parseLong(value);
                } catch (NumberFormatException ex) {
                    // fallback on the double value
                    return value;
                }
            }

            try {
                return Double.parseDouble(value);
            } catch (NumberFormatException ex) {
                // fallback on the string value
                return value;
            }
        }

        if (fieldType.equalsIgnoreCase(FIELD_TYPE_STRING)) {
            result = value;
        }

        if (fieldType.equals(FIELD_TYPE_DOUBLE) || fieldType.equalsIgnoreCase(FIELD_TYPE_DOUBLE2)) {
            try {
                result = Double.parseDouble(value);
            } catch (NumberFormatException ex) {
                if (fieldType.equals(FIELD_TYPE_DOUBLE)) {
                    result = Double.valueOf(0);
                }
            }
        }

        if (fieldType.equals(FIELD_TYPE_LONG) || fieldType.equalsIgnoreCase(FIELD_TYPE_LONG2)) {
            try {
                result = (long) Double.parseDouble(value);
            } catch (NumberFormatException ex) {
                if (fieldType.equals(FIELD_TYPE_LONG)) {
                    result = Long.valueOf(0);
                }
            }
        }

        return result;
    }
399320
public static final Object getValue(Object obj, String fieldName) {
        try {
            return getField(obj.getClass(), fieldName).get(obj);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
833791
public <T> T safeGet(String fieldName){
		try {
			return get(fieldName);
		} catch (Exception e) {
			return null;
		}
	}
892371
function(fieldName, value) {
                var queryStringValue;
                if (!this.hasRegisteredFilterField(fieldName)) {
                    this.registerFilterableField(fieldName, '');
                }
                this.filterableFields[fieldName].value = value;
                if (_.isArray(value)) {
                    queryStringValue = value.join(',');
                } else {
                    queryStringValue = value;
                }
                this.queryParams[fieldName] = function() {
                    return queryStringValue || null;
                };
                this.isStale = true;
            }