/** * {@inheritDoc} */ public Generic asGenericType() { return new Generic.OfNonGenericType.ForErasure(this); }
/** * 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); }
/** * Represents the supplied type description as a generified erasure if it is generified or as a non-generic type if not so. * * @param typeDescription The represented erasure. * @return An appropriate generic type. */ public static Generic of(TypeDescription typeDescription) { return typeDescription.isGenerified() ? new ForGenerifiedErasure(typeDescription) : new OfNonGenericType.ForErasure(typeDescription); }