Package dk.mada.jaxrs.model.types
Enum Class Primitive
- All Implemented Interfaces:
Type
,Serializable
,Comparable<Primitive>
,Constable
Primitive types of the java language (plus String).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable Primitive
Finds a primitive type matching the given type name.boolean
Return true if this type is a primitive.boolean
isPrimitive
(Primitive primitive) Return true if this type is the given primitive.Returns the OpenApi type:format of this primitive.void
setNoformatIntTypes
(Primitive wantedNoformatIntPrimitive) Sets the primitive to use in place of integers without format.typeName()
Returns the type name of this type.static Primitive
Returns the enum constant of this class with the specified name.static Primitive[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Returns the type name of the wrapper of this type.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface dk.mada.jaxrs.model.types.Type
isBigDecimal, isContainer, isDate, isDateTime, isDto, isEnum, isPlainObject, isTime, isUUID, isValidation, isVoid, neededImports
-
Enum Constant Details
-
BOOLEAN
The boolean. -
NOFORMAT_INT
An integer of unknown format. Generator decides how to render this.- See Also:
-
BYTE
The byte. -
SHORT
The short. This cannot be represented by spec's type/format.- See Also:
-
INT
The integer. -
LONG
The long. -
FLOAT
The float. -
DOUBLE
The double. -
STRING
The string (not a primitive, but basically).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
setNoformatIntTypes
Sets the primitive to use in place of integers without format. This gets set by the generator, so technically changes the constant'ness of the type. Not sure how to do it better without affecting all the call sites.- Parameters:
wantedNoformatIntPrimitive
- the type to use for integers without format
-
typeName
Returns the type name of this type. -
wrapperTypeName
Returns the type name of the wrapper of this type.- Specified by:
wrapperTypeName
in interfaceType
- Returns:
- the type name of the wrapper of this type
-
openapiTypeFormat
Returns the OpenApi type:format of this primitive.- Returns:
- the OpenApi type:format of this primitive
-
find
Finds a primitive type matching the given type name.- Parameters:
tn
- the type name to look for- Returns:
- the matching primitive, or null if no matches found
-
isPrimitive
Description copied from interface:Type
Return true if this type is the given primitive.- Specified by:
isPrimitive
in interfaceType
- Parameters:
primitive
- the primitive to compare against- Returns:
- true if the same primitive, otherwise false
-
isPrimitive
public boolean isPrimitive()Description copied from interface:Type
Return true if this type is a primitive.- Specified by:
isPrimitive
in interfaceType
- Returns:
- true if this is a privimive type
-