public final class PrimitiveType extends Type
CodeModel
,
such as CodeModel.BOOLEAN
.Modifier and Type | Method and Description |
---|---|
TypeReference |
array()
Create an array type of this type.
|
TypeReference |
boxify()
Obtains the wrapper class for this primitive type.
|
String |
fullName()
Gets the full name of the type.
|
void |
generate(Formatter f) |
TypeReference |
getWrapperClass()
Deprecated.
Use
boxify() . |
boolean |
isPrimitive()
Tell whether or not this is a built-in primitive type, such as int or void.
|
String |
name()
Gets the name of this type.
|
CodeModel |
owner()
Gets the owner code model object.
|
Type |
unboxify()
Deprecated.
calling this method from
PrimitiveType
would be meaningless, since it's always guaranteed to
return this. |
GeneratedExpression |
unwrap(GeneratedExpression exp)
Do the opposite of the wrap method.
|
GeneratedExpression |
wrap(GeneratedExpression exp)
Wraps an expression of this type to the corresponding wrapper class.
|
binaryName, compareTo, dotclass, elementType, equals, erasure, hashCode, isArray, isReference, parse, toString
public CodeModel owner()
Type
public String fullName()
Type
public boolean isPrimitive()
Type
isPrimitive
in class Type
public TypeReference array()
Type
array
in class Type
TypeReference
representing the array type
whose element type is this typepublic TypeReference boxify()
public Type unboxify()
PrimitiveType
would be meaningless, since it's always guaranteed to
return this.Type
public TypeReference getWrapperClass()
boxify()
.public GeneratedExpression wrap(GeneratedExpression exp)
new Float(x)
for the paramter x.
REVISIT: it's not clear how this method works for VOID.public GeneratedExpression unwrap(GeneratedExpression exp)
public void generate(Formatter f)
Copyright © 2010–2015 MuleSoft, Inc.. All rights reserved.