author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Fri, 03 Apr 2020 16:32:36 +0200 | |
changeset 416 | 9ed8788a1a4e |
parent 142 | e220ab4a7afa |
permissions | -rw-r--r-- |
jtulach@142 | 1 |
package org.apidesign.template; |
jtulach@142 | 2 |
|
jtulach@142 | 3 |
// BEGIN: generics.constructor.template3 |
jtulach@142 | 4 |
public final class Template<T> extends Object { |
jtulach@142 | 5 |
private final Class<T> type; |
jtulach@142 | 6 |
|
jtulach@142 | 7 |
public Template(Class<T> type) { this.type = type; } |
jtulach@142 | 8 |
public Class<T> getType() { return type; } |
jtulach@142 | 9 |
|
jtulach@142 | 10 |
@Deprecated |
jtulach@146 | 11 |
@SuppressWarnings("unchecked") |
jtulach@142 | 12 |
public Template() { this((Class<T>)Object.class); } |
jtulach@142 | 13 |
|
jtulach@142 | 14 |
public static Template<Object> create() { |
jtulach@142 | 15 |
return new Template<Object>(Object.class); |
jtulach@142 | 16 |
} |
jtulach@142 | 17 |
} |
jtulach@142 | 18 |
// END: generics.constructor.template3 |