public static Field getStaticFinalFieldWithValue(Class<?> clazz, long value) {
		Field[] fields = clazz.getDeclaredFields();
		for (Field field : fields) {
			if ((!Modifier.isFinal(field.getModifiers())) ||
				(!Modifier.isStatic(field.getModifiers()))) {
				continue;
			}
			try {
				long fieldValue = field.getLong(null);
				if (fieldValue == value) {
					return field;
				}
			}
			catch (IllegalArgumentException | IllegalAccessException e) {
				// ignore
			}
		}
		return null;
	}
Searches a Class for a final static variable that has a specific numeric value.

@param clazz Class to search.
@param value numeric value to search for
@return Java reflection {@link Field} that has the specified value or null
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf/DWARFUtil.java