- java.lang.Object
-
- com.speedment.common.codegen.constant.DefaultType
-
public final class DefaultType extends Object
Constant implementations of theTypeinterface that can be used to reference standard java types. If a modifying method is called on any of these objects, the model will be copied before performing the operation. This makes sure the original state of the constant is never changed.- Author:
- Emil Forslund
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Typebiconsumer(Type innerTypeA, Type innerTypeB)static Typebifunction(Type innerTypeA, Type innerTypeB, Type innerTypeC)Generates aTypeto represent a java standardBiFunctionwith generic type variables.static TypebinaryOperator(Type innerType)Generates aTypeto represent a java standardBinaryOperatorwith generic type variables.static Typebipredicate(Type innerTypeA, Type innerTypeB)Generates aTypeto represent a java standardBiPredicatewith a generic type variable.static TypeclassOf(Type innerType)static Typeconsumer(Type innerType)static TypedoubleFunction(Type innerType)Generates aTypeto represent a java standardDoubleFunctionwith generic type variables.static Typeentry(Type innerTypeA, Type innerTypeB)static Typefunction(Type innerTypeA, Type innerTypeB)static TypegenericType(Type type, Type... typeParameters)Returns a newSimpleParameterizedTypewith the specified type parameters.static TypegenericType(Type type, String... typeParameters)Returns a newSimpleParameterizedTypewith the specified type parameters.static TypeintFunction(Type innerType)Generates aTypeto represent a java standardIntFunctionwith generic type variables.static booleanisPrimitive(Type type)Returnstrueif the specified type is a primitive type.static booleanisWrapper(Type type)Returnstrueif the specified type is a wrapper type, elsefalse.static Typelist(Type innerType)static TypelongFunction(Type innerType)Generates aTypeto represent a java standardLongFunctionwith generic type variables.static Typemap(Type innerTypeA, Type innerTypeB)static Typeoptional(Type innerType)static Typepredicate(Type innerType)static Stream<Type>primitiveTypes()Returns a stream of all the primitive types in the java language.static Typequeue(Type innerType)static Typeset(Type innerType)static Typestack(Type innerType)static Typestream(Type innerType)static Typesupplier(Type innerType)static TypetoDoubleFunction(Type innerType)Generates aTypeto represent a java standardToDoubleFunctionwith generic type variables.static TypetoIntFunction(Type innerType)Generates aTypeto represent a java standardToIntFunctionwith generic type variables.static TypetoLongFunction(Type innerType)Generates aTypeto represent a java standardToLongFunctionwith generic type variables.static TypeunaryOperator(Type innerType)Generates aTypeto represent a java standardUnaryOperatorwith generic type variables.static Class<?>wrapperFor(Type primitiveType)Returns the corresponding wrapper type for the specified primitive type.static Stream<Type>wrapperTypes()Returns a stream of all the wrapper types in the java language.
-
-
-
Field Detail
-
WILDCARD
public static final Type WILDCARD
-
-
Method Detail
-
genericType
public static Type genericType(Type type, Type... typeParameters)
Returns a newSimpleParameterizedTypewith the specified type parameters.- Parameters:
type- the base typetypeParameters- all its type parameters- Returns:
- the new generic type
- Since:
- 2.5
-
genericType
public static Type genericType(Type type, String... typeParameters)
Returns a newSimpleParameterizedTypewith the specified type parameters.- Parameters:
type- the base typetypeParameters- all its type parameters- Returns:
- the new generic type
- Since:
- 2.5
-
classOf
public static Type classOf(Type innerType)
- Parameters:
innerType- the type variable- Returns:
- the resulting type
-
list
public static Type list(Type innerType)
- Parameters:
innerType- the type variable- Returns:
- the resulting type
-
set
public static Type set(Type innerType)
- Parameters:
innerType- the type variable- Returns:
- the resulting type
-
map
public static Type map(Type innerTypeA, Type innerTypeB)
- Parameters:
innerTypeA- the first type variableinnerTypeB- the second type variable- Returns:
- the resulting type
-
queue
public static Type queue(Type innerType)
- Parameters:
innerType- the type variable- Returns:
- the resulting type
-
stack
public static Type stack(Type innerType)
- Parameters:
innerType- the type variable- Returns:
- the resulting type
-
optional
public static Type optional(Type innerType)
- Parameters:
innerType- the type variable- Returns:
- the resulting type
-
entry
public static Type entry(Type innerTypeA, Type innerTypeB)
- Parameters:
innerTypeA- the first type variableinnerTypeB- the second type variable- Returns:
- the resulting type
-
function
public static Type function(Type innerTypeA, Type innerTypeB)
- Parameters:
innerTypeA- the first type variableinnerTypeB- the second type variable- Returns:
- the resulting type
-
bifunction
public static Type bifunction(Type innerTypeA, Type innerTypeB, Type innerTypeC)
Generates aTypeto represent a java standardBiFunctionwith generic type variables.- Parameters:
innerTypeA- the first type variableinnerTypeB- the second type variableinnerTypeC- the third type variable- Returns:
- the resulting type
- Since:
- 2.5
-
intFunction
public static Type intFunction(Type innerType)
Generates aTypeto represent a java standardIntFunctionwith generic type variables.- Parameters:
innerType- the inner type- Returns:
- the resulting type
- Since:
- 2.5
-
longFunction
public static Type longFunction(Type innerType)
Generates aTypeto represent a java standardLongFunctionwith generic type variables.- Parameters:
innerType- the inner type- Returns:
- the resulting type
- Since:
- 2.5
-
doubleFunction
public static Type doubleFunction(Type innerType)
Generates aTypeto represent a java standardDoubleFunctionwith generic type variables.- Parameters:
innerType- the inner type- Returns:
- the resulting type
- Since:
- 2.5
-
toIntFunction
public static Type toIntFunction(Type innerType)
Generates aTypeto represent a java standardToIntFunctionwith generic type variables.- Parameters:
innerType- the inner type- Returns:
- the resulting type
- Since:
- 2.5
-
toLongFunction
public static Type toLongFunction(Type innerType)
Generates aTypeto represent a java standardToLongFunctionwith generic type variables.- Parameters:
innerType- the inner type- Returns:
- the resulting type
- Since:
- 2.5
-
toDoubleFunction
public static Type toDoubleFunction(Type innerType)
Generates aTypeto represent a java standardToDoubleFunctionwith generic type variables.- Parameters:
innerType- the inner type- Returns:
- the resulting type
- Since:
- 2.5
-
unaryOperator
public static Type unaryOperator(Type innerType)
Generates aTypeto represent a java standardUnaryOperatorwith generic type variables.- Parameters:
innerType- the inner type- Returns:
- the resulting type
- Since:
- 2.5
-
binaryOperator
public static Type binaryOperator(Type innerType)
Generates aTypeto represent a java standardBinaryOperatorwith generic type variables.- Parameters:
innerType- the inner type- Returns:
- the resulting type
- Since:
- 2.5
-
predicate
public static Type predicate(Type innerType)
- Parameters:
innerType- the type variable- Returns:
- the resulting type
-
bipredicate
public static Type bipredicate(Type innerTypeA, Type innerTypeB)
Generates aTypeto represent a java standardBiPredicatewith a generic type variable.- Parameters:
innerTypeA- the first type variableinnerTypeB- the second type variable- Returns:
- the resulting type
- Since:
- 2.5
-
consumer
public static Type consumer(Type innerType)
- Parameters:
innerType- the type variable- Returns:
- the resulting type
-
biconsumer
public static Type biconsumer(Type innerTypeA, Type innerTypeB)
- Parameters:
innerTypeA- the first type variableinnerTypeB- the second type variable- Returns:
- the resulting type
- Since:
- 2.5
-
supplier
public static Type supplier(Type innerType)
- Parameters:
innerType- the type variable- Returns:
- the resulting type
-
stream
public static Type stream(Type innerType)
- Parameters:
innerType- the type variable- Returns:
- the resulting type
-
isPrimitive
public static boolean isPrimitive(Type type)
Returnstrueif the specified type is a primitive type. Wrapper types does not count as primitives.- Parameters:
type- the type to check- Returns:
trueif it is primitive, elsefalse
-
isWrapper
public static boolean isWrapper(Type type)
Returnstrueif the specified type is a wrapper type, elsefalse.- Parameters:
type- the type to check- Returns:
trueif it is a wrapper, elsefalse- Since:
- 2.5
-
wrapperFor
public static Class<?> wrapperFor(Type primitiveType)
Returns the corresponding wrapper type for the specified primitive type. If the type is not primitive, an exception is thrown.- Parameters:
primitiveType- the primitive type- Returns:
- the corresponding wrapper type
-
primitiveTypes
public static Stream<Type> primitiveTypes()
Returns a stream of all the primitive types in the java language.- Returns:
- stream of types
-
-