/** * Append a class or interface bound * * @param bound Bound to append * @param output Output to append to * @param <A> Type of output * @return Supplied output to append to */ public <A extends Appendable> A appendClassOrInterfaceBound(Generic bound, A output) { try { output.append(':'); appendReferenceTypeSignature(bound, Nullness.UNDEFINED, output); return output; } catch (Exception e) { throw new RuntimeException(String.format("Could write class or interface bound %s", bound)); } }
/** * Append a class or interface bound * * @param bound Bound to append * @param output Output to append to * @param <A> Type of output * @return Supplied output to append to */ public <A extends Appendable> A appendClassOrInterfaceBound(Generic bound, A output) { try { output.append(':'); appendReferenceTypeSignature(bound, Nullness.UNDEFINED, output); return output; } catch (Exception e) { throw new RuntimeException(String.format("Could write class or interface bound %s", bound)); } }
/** * Append a type * * @param type Type to append * @param nullable Nullness of type * @param output Output to append to * @param <A> Type of output * @return Supplied output to append to */ public <A extends Appendable> A appendJavaTypeSignature(Generic type, Nullness nullable, A output) { try { if (type.isPrimitive()) { appendBaseType(type, output); } else { appendReferenceTypeSignature(type, nullable, output); } return output; } catch (Exception e) { throw new RuntimeException(String.format("Could not write java type signature %s", type)); } }
/** * Append a type * * @param type Type to append * @param nullable Nullness of type * @param output Output to append to * @param <A> Type of output * @return Supplied output to append to */ public <A extends Appendable> A appendJavaTypeSignature(Generic type, Nullness nullable, A output) { try { if (type.isPrimitive()) { appendBaseType(type, output); } else { appendReferenceTypeSignature(type, nullable, output); } return output; } catch (Exception e) { throw new RuntimeException(String.format("Could not write java type signature %s", type)); } }
appendReferenceTypeSignature(typeArgument.getLowerBounds().get(0), Nullness.UNDEFINED, output); appendReferenceTypeSignature(upperBounds.get(0), Nullness.UNDEFINED, output); appendReferenceTypeSignature(typeArgument, Nullness.UNDEFINED, output);
appendReferenceTypeSignature(typeArgument.getLowerBounds().get(0), Nullness.UNDEFINED, output); appendReferenceTypeSignature(upperBounds.get(0), Nullness.UNDEFINED, output); appendReferenceTypeSignature(typeArgument, Nullness.UNDEFINED, output);