/** * Creates a new generic type representation for an erasure where any generified type is reified. * * @param typeDescription The erasure to represent. * @return An appropriate generic type representation where any generified type is reified. */ protected static Generic of(TypeDescription typeDescription) { return typeDescription.isGenerified() ? new ForReifiedErasure(typeDescription) : new ForErasure(typeDescription); }
/** * {@inheritDoc} */ public Generic onNonGenericType(Generic typeDescription) { TypeDescription erasure = typeDescription.asErasure(); return erasure.isGenerified() ? new OfNonGenericType.ForReifiedErasure(erasure) : typeDescription; } }