@SuppressWarnings("unchecked")
		protected static <T> T fromPrimitive(Object value, int size,
				PcodeArithmetic<T> arithmetic) {
			return switch (value) {
				case null -> null;
				case Byte v -> arithmetic.fromConst(v, size);
				case Short v -> arithmetic.fromConst(v, size);
				case Integer v -> arithmetic.fromConst(v, size);
				case Long v -> arithmetic.fromConst(v, size);
				case Float v -> arithmetic.fromConst(v, size);
				case Double v -> arithmetic.fromConst(v, size);
				case Boolean v -> arithmetic.fromConst(v, size);
				default -> (T) value;
			};
		}
A wrapped, annotated Java method, exported as a userop definition

@param <T> the type of data processed by the userop
Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/exec/AnnotatedPcodeUseropLibrary.java