Package org.axonframework.common
Class TypeReference<E>
java.lang.Object
org.axonframework.common.TypeReference<E>
- Type Parameters:
E- The type of the component.
Represents a reference to a type of component, allowing for generic types to be specified without casting errors.
- Since:
- 5.0.0
- Author:
- Mitchell Herrijgers
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic <C> TypeReference<C> Constructs aTypeReferencefor the givenclazz.static <C> TypeReference<C> Constructs aTypeReferencefor the giventype.getType()Returns the type of the component represented by thisTypeReference.Returns the class of the type of the component represented by thisTypeReference.inthashCode()
-
Field Details
-
type
-
-
Constructor Details
-
TypeReference
protected TypeReference()
-
-
Method Details
-
fromClass
Constructs aTypeReferencefor the givenclazz.- Type Parameters:
C- The clazz thisTypeReferencereflects.- Parameters:
clazz- The clazz of theTypeReferenceunder construction.- Returns:
- A new
TypeReferenceinstance of the givenclazz.
-
fromType
Constructs aTypeReferencefor the giventype.- Type Parameters:
C- The type thisTypeReferencereflects.- Parameters:
type- The type of theTypeReferenceunder construction.- Returns:
- A new
TypeReferenceinstance of the giventype.
-
getTypeAsClass
Returns the class of the type of the component represented by thisTypeReference.- Returns:
- The class of the component.
-
getType
Returns the type of the component represented by thisTypeReference.- Returns:
- The type of the component.
-
equals
-
hashCode
public int hashCode()
-