public interface TypeEnvironment
Type
.
For example:
Consider the type returned by methodclass Shop<T>{ List<T> getCatalog() { ... } } class Bakery extends Shop<Bread>{}
getCatalog()
. There are
two possible contexts here. In the context of Shop
, the type
is List<T>
. In the context of Bakery
, the
type is List<Bread>
. Each of these contexts can be
represented by a TypeEnvironment
.Modifier and Type | Method and Description |
---|---|
Type |
bind(Type type)
Binds as many generic components of the given type as possible in this
context.
|
Type bind(Type type)
Type
is a Class
,
then it's guaranteed to be a regular Java Class
. In all
other cases, this method might return a custom implementation of some
interface that extends Type
. Be sure not to mix these
objects with Java's implementations of Type
to avoid
potential identity problems.
This class does not support bindings involving inner classes or
upper/lower bounds.Copyright © 2017 JBoss by Red Hat. All rights reserved.