Package io.swagger.util
Enum PrimitiveType
- java.lang.Object
-
- java.lang.Enum<PrimitiveType>
-
- io.swagger.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.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BINARYBinaryBOOLEANBoolean.BYTEByte.DATEDate.DATE_TIMEDate and time.DECIMALGeneric decimal number without specific format.DOUBLE64-bit decimal.FILENative Java file.FLOAT32-bit decimal.INT32-bit integer.INTEGERGeneric integer number without specific format.LONG64-bit integer.OBJECTGeneric object.STRINGString.URIURI string.URLURL string.UUIDUUID string.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract PropertycreateProperty()static PropertycreateProperty(Type type)static PropertycreateProperty(String name)static Map<String,PrimitiveType>customClasses()Adds support for custom mapping of classes to primitive typesstatic Set<String>customExcludedClasses()Adds support for custom excluded classesstatic Set<String>customExcludedExternalClasses()Adds support for custom excluded external classesstatic PrimitiveTypefromName(String name)static PrimitiveTypefromType(Type type)StringgetCommonName()static StringgetCommonName(Type type)Class<?>getKeyClass()static 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
-
BOOLEAN
public static final PrimitiveType BOOLEAN
Boolean.
-
STRING
public static final PrimitiveType STRING
String.
-
BYTE
public static final PrimitiveType BYTE
Byte.
-
BINARY
public static final PrimitiveType BINARY
Binary
-
URI
public static final PrimitiveType URI
URI string.
-
URL
public static final PrimitiveType URL
URL string.
-
UUID
public static final PrimitiveType UUID
UUID string.
-
INT
public static final PrimitiveType INT
32-bit integer.
-
LONG
public static final PrimitiveType LONG
64-bit integer.
-
FLOAT
public static final PrimitiveType FLOAT
32-bit decimal.
-
DOUBLE
public static final PrimitiveType DOUBLE
64-bit decimal.
-
INTEGER
public static final PrimitiveType INTEGER
Generic integer number without specific format.
-
DECIMAL
public static final PrimitiveType DECIMAL
Generic decimal number without specific format.
-
DATE
public static final PrimitiveType DATE
Date.
-
DATE_TIME
public static final PrimitiveType DATE_TIME
Date and time.
-
FILE
public static final PrimitiveType FILE
Native Java file.
-
OBJECT
public static final PrimitiveType OBJECT
Generic 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 excluded classes- Returns:
- Set of custom excluded classes
- Since:
- 1.6.6
-
customExcludedExternalClasses
public static Set<String> customExcludedExternalClasses()
Adds support for custom excluded external classes- Returns:
- Set of custom excluded external classes
-
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:
- 1.6.13
-
fromType
public static PrimitiveType fromType(Type type)
-
fromName
public static PrimitiveType fromName(String name)
-
getKeyClass
public Class<?> getKeyClass()
-
getCommonName
public String getCommonName()
-
createProperty
public abstract Property createProperty()
-
-