[][src]Struct charjpoet::poet::type_name::TypeName

pub struct TypeName {}

Any type in Java's type system, plus {@code void}. This class is an identifier for primitive types like {@code int} and raw reference types like {@code String} and {@code List}. It also identifies composite types like {@code char[]} and {@code Set}.

Type names are dumb identifiers only and do not model the values they name. For example, the type name for {@code java.util.List} doesn't know about the {@code size()} method, the fact that lists are collections, or even that it accepts a single type parameter.

Instances of this class are immutable value objects that implement {@code equals()} and {@code hashCode()} properly.

Referencing existing types

Primitives and void are constants that you can reference directly: see {@link #INT}, {@link #DOUBLE}, and {@link #VOID}.

In an annotation processor you can get a type name instance for a type mirror by calling {@link #get(TypeMirror)}. In reflection code, you can use {@link #get(Type)}.

Defining new types

Create new reference types like {@code com.example.HelloWorld} with {@link ClassName#get(String, String, String...)}. To build composite types like {@code char[]} and {@code Set}, use the factory methods on {@link ArrayTypeName}, {@link ParameterizedTypeName}, {@link TypeVariableName}, and {@link WildcardTypeName}.

Trait Implementations

impl Clone for TypeName[src]

impl Debug for TypeName[src]

impl<'de> Deserialize<'de> for TypeName[src]

impl Serialize for TypeName[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.