public <R> R getValue(T structInstance, Class<R> expectedType) throws IOException {
		try {
			Object val = fmi.getField().get(structInstance);
			if (expectedType.isInstance(val)) {
				return expectedType.cast(val);
			}
		}
		catch (IllegalArgumentException | IllegalAccessException e) {
			throw new IOException(e);
		}
		return null;
	}
Returns the value of this java field.

@param <R> type of the result value
@param structInstance object containing the field
@param expectedType expected class of the value 
@return value of the field, or null if the field's value is not of expected type
@throws IOException if error accessing java field
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/structmapping/FieldOutputInfo.java