@Test void actualTypeArgument() { TypeInfo sut = TypeInfo.ofParameter(randomMethod(), OPTIONAL_PARAMETER); TypeInfo result = sut.actualTypeArgument(0); assertThat(result.rawClass(), equalTo(String.class)); }
public TypeInfo actualTypeArgument(int index) { return new TypeInfo(parameterizedType .map(p -> typeArg(p, index)) .orElseThrow(() -> new NoSuchElementException(TypeUtil.toString(type) + " is not a parameterized type so does not have actual type arguments."))); }
TypeInfo { public TypeInfo actualTypeArgument(int index) { return new TypeInfo(parameterizedType .map(p -> typeArg(p, index)) .orElseThrow(() -> new NoSuchElementException(TypeUtil.toString(type) + " is not a parameterized type so does not have actual type arguments."))); } }
TypeInfo { public TypeInfo actualTypeArgument(int index) { return new TypeInfo(parameterizedType .map(p -> typeArg(p, index)) .orElseThrow(() -> new NoSuchElementException(TypeUtil.toString(type) + " is not a parameterized type so does not have actual type arguments."))); } private  TypeInfo(Type type); }
TypeInfo { public TypeInfo actualTypeArgument(int index) { return new TypeInfo(parameterizedType .map(p -> typeArg(p, index)) .orElseThrow(() -> new NoSuchElementException(TypeUtil.toString(type) + " is not a parameterized type so does not have actual type arguments."))); } private  TypeInfo(Type type); @Override String toString(); TypeInfo arrayComponentType(); TypeInfo actualTypeArgument(int index); Class<?> rawClass(); static TypeInfo ofParameter(Method method, int parameter); }
TypeInfo { public TypeInfo actualTypeArgument(int index) { return new TypeInfo(parameterizedType .map(p -> typeArg(p, index)) .orElseThrow(() -> new NoSuchElementException(TypeUtil.toString(type) + " is not a parameterized type so does not have actual type arguments."))); } private  TypeInfo(Type type); @Override String toString(); TypeInfo arrayComponentType(); TypeInfo actualTypeArgument(int index); Class<?> rawClass(); static TypeInfo ofParameter(Method method, int parameter);  }