T - the type being representedpublic abstract class TypeLiteral<T> extends Object implements Serializable
Type,
Serialized Form| Modifier | Constructor and Description |
|---|---|
protected |
TypeLiteral()
Creates a new
TypeLiteral. |
protected |
TypeLiteral(Class<T> classHierarchyParent)
Creates a new
TypeLiteral with a deeper class hierarchy. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other)
|
Type |
getType()
Returns the
Type represented by this TypeLiteral. |
int |
hashCode()
Returns a hashcode for this
TypeLiteral based off its
Type's hashcode. |
String |
toString()
|
protected TypeLiteral()
TypeLiteral.protected TypeLiteral(Class<T> classHierarchyParent)
TypeLiteral with a deeper class hierarchy.
This specialized constructor is for use only by abstract subclasses of TypeLiteral that are extending
and looking to use the subsequently extended type inspection
capabilities of this class.
T - a type representing a subclass of TypeLiteralclassHierarchyParent - the first class beneath this class in
the subclass hierarchy whose immediate subclasses will be
inspected for parameterized type information; must not be nullNullPointerException - if classHierarchyParent
is nullpublic final Type getType()
Type represented by this TypeLiteral;
never nullIllegalStateException - if somehow this TypeLiteral was instantiated without a type parameterpublic int hashCode()
TypeLiteral based off its
Type's hashcode.hashCode in class ObjectTypeLiteralequals(Object)public boolean equals(Object other)
true if the supplied Object is equal to
this TypeLiteral.
Two TypeLiteral instances are equal if their getType() methods' return values are equal.
equals in class Objectother - the Object to test; may be nulltrue if the supplied Object is equal to
this TypeLiteral; false otherwisehashCode()public String toString()
null String representation of this
TypeLiteral.
This method never returns null.
Overrides of this method must not return null.
toString in class Objectnull String representation of this
TypeLiteralCopyright © 2017–2018, microBean. All rights reserved.