Package io.swagger.v3.core.util
Enum PrimitiveType
- java.lang.Object
-
- java.lang.Enum<PrimitiveType>
-
- io.swagger.v3.core.util.PrimitiveType
-
- All Implemented Interfaces:
Serializable,Comparable<PrimitiveType>
public enum PrimitiveType extends Enum<PrimitiveType>
ThePrimitiveTypeenumeration defines a mapping of limited set of classes into Swagger primitive types.
-
-
Field Summary
Fields Modifier and Type Field Description static Map<String,String>datatypeMappings
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract SchemacreateProperty()static SchemacreateProperty(Type type)static SchemacreateProperty(String name)static Map<String,PrimitiveType>customClasses()Adds support for custom mapping of classes to primitive typesstatic Set<String>customExcludedClasses()Adds support for custom mapping of classes to primitive typesstatic Set<String>customExcludedExternalClasses()Adds support for custom mapping of classes to primitive typesstatic voidenablePartialTime()Convenience method to map LocalTime to string primitive with rfc3339 format partial-time.static PrimitiveTypefromName(String name)static PrimitiveTypefromType(Type type)static PrimitiveTypefromTypeAndFormat(Type type, String format)static PrimitiveTypefromTypeAndFormat(String type, String format)StringgetCommonName()static StringgetCommonName(Type type)Class<?>getKeyClass()static Set<String>nonSystemTypePackages()package names NOT to be considered as "system" typesstatic Set<String>nonSystemTypes()class qualified names NOT to be considered as "system" typesstatic Set<String>systemPrefixes()class qualified names prefixes to be considered as "system" typesstatic PrimitiveTypevalueOf(String name)Returns the enum constant of this type with the specified name.static PrimitiveType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
STRING
public static final PrimitiveType STRING
-
BOOLEAN
public static final PrimitiveType BOOLEAN
-
BYTE
public static final PrimitiveType BYTE
-
BINARY
public static final PrimitiveType BINARY
-
URI
public static final PrimitiveType URI
-
URL
public static final PrimitiveType URL
-
EMAIL
public static final PrimitiveType EMAIL
-
UUID
public static final PrimitiveType UUID
-
INT
public static final PrimitiveType INT
-
LONG
public static final PrimitiveType LONG
-
FLOAT
public static final PrimitiveType FLOAT
-
DOUBLE
public static final PrimitiveType DOUBLE
-
INTEGER
public static final PrimitiveType INTEGER
-
DECIMAL
public static final PrimitiveType DECIMAL
-
NUMBER
public static final PrimitiveType NUMBER
-
DATE
public static final PrimitiveType DATE
-
DATE_TIME
public static final PrimitiveType DATE_TIME
-
PARTIAL_TIME
public static final PrimitiveType PARTIAL_TIME
-
FILE
public static final PrimitiveType FILE
-
OBJECT
public static final PrimitiveType OBJECT
-
-
Method Detail
-
values
public static PrimitiveType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PrimitiveType c : PrimitiveType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PrimitiveType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
customExcludedClasses
public static Set<String> customExcludedClasses()
Adds support for custom mapping of classes to primitive types- Returns:
- Map of custom classes to primitive type
- Since:
- 2.0.6
-
customExcludedExternalClasses
public static Set<String> customExcludedExternalClasses()
Adds support for custom mapping of classes to primitive types- Returns:
- Map of custom classes to primitive type
- Since:
- 2.1.2
-
customClasses
public static Map<String,PrimitiveType> customClasses()
Adds support for custom mapping of classes to primitive types- Returns:
- Map of custom classes to primitive type
- Since:
- 2.0.6
-
systemPrefixes
public static Set<String> systemPrefixes()
class qualified names prefixes to be considered as "system" types- Returns:
- Mutable set of class qualified names prefixes to be considered as "system" types
- Since:
- 2.0.6
-
nonSystemTypes
public static Set<String> nonSystemTypes()
class qualified names NOT to be considered as "system" types- Returns:
- Mutable set of class qualified names NOT to be considered as "system" types
- Since:
- 2.0.6
-
nonSystemTypePackages
public static Set<String> nonSystemTypePackages()
package names NOT to be considered as "system" types- Returns:
- Mutable set of package names NOT to be considered as "system" types
- Since:
- 2.0.6
-
fromTypeAndFormat
public static PrimitiveType fromTypeAndFormat(Type type, String format)
-
fromType
public static PrimitiveType fromType(Type type)
-
fromName
public static PrimitiveType fromName(String name)
-
fromTypeAndFormat
public static PrimitiveType fromTypeAndFormat(String type, String format)
-
getKeyClass
public Class<?> getKeyClass()
-
getCommonName
public String getCommonName()
-
createProperty
public abstract Schema createProperty()
-
enablePartialTime
public static void enablePartialTime()
Convenience method to map LocalTime to string primitive with rfc3339 format partial-time. See https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14- Since:
- 2.0.6
-
-