/** * Append a type variable signature * * @param typeVariable Type variable to append signature * @param nullable Nullness of type variable * @param output Output to append to * @param <A> Type of output * @return Supplied output to append to */ public <A extends Appendable> A appendTypeVariableSignature(Generic typeVariable, Nullness nullable, A output) { try { output.append('T').append(nullable.getMarker()).append(typeVariable.getTypeName()).append(';'); return output; } catch (Exception e) { throw new RuntimeException(String.format("Could not type variable %s", typeVariable)); } }
/** * Append a type variable signature * * @param typeVariable Type variable to append signature * @param nullable Nullness of type variable * @param output Output to append to * @param <A> Type of output * @return Supplied output to append to */ public <A extends Appendable> A appendTypeVariableSignature(Generic typeVariable, Nullness nullable, A output) { try { output.append('T').append(nullable.getMarker()).append(typeVariable.getTypeName()).append(';'); return output; } catch (Exception e) { throw new RuntimeException(String.format("Could not type variable %s", typeVariable)); } }
/** * Append an array type signature * * @param type Array 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 appendArrayTypeSignature(Generic type, Nullness nullable, A output) { try { output.append('[').append(nullable.getMarker()); appendJavaTypeSignature(Validate.notNull(type.getComponentType()), Nullness.UNDEFINED, output); return output; } catch (Exception e) { throw new RuntimeException(String.format("Could not write array type %s", type)); } }
output.append('L').append(nullable.getMarker());
output.append('L').append(nullable.getMarker());
/** * Append an array type signature * * @param type Array 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 appendArrayTypeSignature(Generic type, Nullness nullable, A output) { try { output.append('[').append(nullable.getMarker()); appendJavaTypeSignature(Validate.notNull(type.getComponentType()), Nullness.UNDEFINED, output); return output; } catch (Exception e) { throw new RuntimeException(String.format("Could not write array type %s", type)); } }