本文整理汇总了Java中io.swagger.models.properties.DoubleProperty类的典型用法代码示例。如果您正苦于以下问题:Java DoubleProperty类的具体用法?Java DoubleProperty怎么用?Java DoubleProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DoubleProperty类属于io.swagger.models.properties包,在下文中一共展示了DoubleProperty类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initPropertyMap
import io.swagger.models.properties.DoubleProperty; //导入依赖的package包/类
private static void initPropertyMap() {
PROPERTY_MAP.put(BooleanProperty.class, SimpleType.constructUnsafe(Boolean.class));
PROPERTY_MAP.put(FloatProperty.class, SimpleType.constructUnsafe(Float.class));
PROPERTY_MAP.put(DoubleProperty.class, SimpleType.constructUnsafe(Double.class));
PROPERTY_MAP.put(DecimalProperty.class, SimpleType.constructUnsafe(BigDecimal.class));
PROPERTY_MAP.put(ByteProperty.class, SimpleType.constructUnsafe(Byte.class));
PROPERTY_MAP.put(ShortProperty.class, SimpleType.constructUnsafe(Short.class));
PROPERTY_MAP.put(IntegerProperty.class, SimpleType.constructUnsafe(Integer.class));
PROPERTY_MAP.put(BaseIntegerProperty.class, SimpleType.constructUnsafe(Integer.class));
PROPERTY_MAP.put(LongProperty.class, SimpleType.constructUnsafe(Long.class));
// stringProperty包含了enum的场景,并不一定是转化为string
// 但是,如果统一走StringPropertyConverter则可以处理enum的场景
PROPERTY_MAP.put(StringProperty.class, SimpleType.constructUnsafe(String.class));
PROPERTY_MAP.put(DateProperty.class, SimpleType.constructUnsafe(LocalDate.class));
PROPERTY_MAP.put(DateTimeProperty.class, SimpleType.constructUnsafe(Date.class));
PROPERTY_MAP.put(ByteArrayProperty.class, SimpleType.constructUnsafe(byte[].class));
PROPERTY_MAP.put(FileProperty.class, SimpleType.constructUnsafe(Part.class));
}
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:25,代码来源:ConverterMgr.java
示例2: getSwaggerArrayProperty
import io.swagger.models.properties.DoubleProperty; //导入依赖的package包/类
private static Property getSwaggerArrayProperty(TypeToken<?> typeToken) {
Class<?> type = typeToken.getRawType();
if (type == String.class) {
return new StringProperty();
} else if (type == Boolean.class || type == Boolean.TYPE) {
return new BooleanProperty();
} else if (type == Integer.class || type == Integer.TYPE) {
return new IntegerProperty();
} else if (type == Long.class || type == Long.TYPE) {
return new LongProperty();
} else if (type == Float.class || type == Float.TYPE) {
return new FloatProperty();
} else if (type == Double.class || type == Double.TYPE) {
return new DoubleProperty();
} else if (type == byte[].class) {
return new ByteArrayProperty();
} else if (type.isEnum()) {
return new StringProperty();
}
throw new IllegalArgumentException("invalid property type");
}
开发者ID:cloudendpoints,项目名称:endpoints-java,代码行数:22,代码来源:SwaggerGenerator.java
示例3: makeProperty
import io.swagger.models.properties.DoubleProperty; //导入依赖的package包/类
private Property makeProperty(PropertyDescription pd) {
switch (pd.typeName) {
case BOOLEAN:
return new BooleanProperty();
case BYTES:
return new BinaryProperty();
case COLLECTION:
return new ArrayProperty(makeProperty(pd.elementDescription));
case DATE:
return new DateTimeProperty();
case DOUBLE:
return new DoubleProperty();
case ENUM:
StringProperty prop = new StringProperty();
if (pd.enumValues != null) {
prop._enum(Arrays.asList(pd.enumValues));
}
return prop;
case InternetAddressV4:
return new StringProperty();
case InternetAddressV6:
return new StringProperty();
case LONG:
return new LongProperty();
case MAP:
return new MapProperty(new StringProperty());
case PODO:
return refProperty(pd);
case STRING:
return new StringProperty();
case URI:
return new StringProperty(Format.URI);
default:
throw new IllegalStateException("unknown type " + pd.typeName);
}
}
开发者ID:vmware,项目名称:xenon-utils,代码行数:37,代码来源:ModelRegistry.java
示例4: setResponseType
import io.swagger.models.properties.DoubleProperty; //导入依赖的package包/类
private void setResponseType(Response response, String type) {
try {
Class<?> clazz;
switch (type) {
case "int":
case "long":
case "short":
case "byte":
case "double":
case "float":
clazz = Double.class;
break;
case "char":
clazz = Character.class;
break;
case "boolean":
clazz = Boolean.class;
break;
default:
clazz = Class.forName(type);
}
if (clazz == Object.class || clazz == JsonObject.class) {
// a generic JSON
response.setSchema(new ObjectProperty());
} else if (Number.class.isAssignableFrom(clazz)) {
response.setSchema(new DoubleProperty());
} else if (clazz == Boolean.class) {
response.setSchema(new BooleanProperty());
} else if (clazz == String.class || clazz == Character.class) {
response.setSchema(new StringProperty());
} else if (clazz != Void.class) {
response.setSchema(refProperty(modelForPodo(clazz)));
}
} catch (ClassNotFoundException ex) {
Logger.getLogger(SwaggerAssembler.class.getName()).log(Level.SEVERE, null, ex);
}
}
开发者ID:vmware,项目名称:xenon-utils,代码行数:39,代码来源:SwaggerAssembler.java
示例5: getItems
import io.swagger.models.properties.DoubleProperty; //导入依赖的package包/类
public static Property getItems(DataType dataType) {
if (DataType.String.equals(dataType))
return new StringProperty();
else if (DataType.Integer.equals(dataType))
return new IntegerProperty();
else if (DataType.Boolean.equals(dataType))
return new BooleanProperty();
else if (DataType.Number.equals(dataType))
return new DoubleProperty();
return null;
}
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:12,代码来源:SwaggerUtils.java
示例6: map_ReturnsEmptyMap_ForNonArraySchema
import io.swagger.models.properties.DoubleProperty; //导入依赖的package包/类
@Test
public void map_ReturnsEmptyMap_ForNonArraySchema() {
// Assert
TupleEntity entity = new TupleEntity(
ImmutableMap.of(MediaType.APPLICATION_JSON_TYPE, new DoubleProperty()), result);
// Act
Object mappedEntity = tupleEntityMapper.map(entity, MediaType.APPLICATION_JSON_TYPE);
// Assert
assertThat(mappedEntity, equalTo(ImmutableMap.of()));
}
开发者ID:dotwebstack,项目名称:dotwebstack-framework,代码行数:13,代码来源:TupleEntityMapperTest.java
示例7: setUp
import io.swagger.models.properties.DoubleProperty; //导入依赖的package包/类
@Before
public void setUp() {
schemaMapper = new DoubleSchemaMapper();
property = new DoubleProperty();
when(entityBuilderContext.getLdPathExecutor()).thenReturn(ldPathExecutor);
schemaMapperAdapter = new SchemaMapperAdapter(Arrays.asList(schemaMapper));
}
开发者ID:dotwebstack,项目名称:dotwebstack-framework,代码行数:9,代码来源:DoubleSchemaMapperTest.java
示例8: getDefaultValue
import io.swagger.models.properties.DoubleProperty; //导入依赖的package包/类
public static String getDefaultValue(Property property){
Validate.notNull(property, "property must not be null!");
String defaultValue = "";
if(property instanceof BooleanProperty){
BooleanProperty booleanProperty = (BooleanProperty)property;
defaultValue = Objects.toString(booleanProperty.getDefault(), "");
}else if(property instanceof StringProperty){
StringProperty stringProperty = (StringProperty)property;
defaultValue = Objects.toString(stringProperty.getDefault(), "");
}else if(property instanceof DoubleProperty){
DoubleProperty doubleProperty = (DoubleProperty)property;
defaultValue = Objects.toString(doubleProperty.getDefault(), "");
}else if(property instanceof FloatProperty){
FloatProperty floatProperty = (FloatProperty)property;
defaultValue = Objects.toString(floatProperty.getDefault(), "");
}else if(property instanceof IntegerProperty){
IntegerProperty integerProperty = (IntegerProperty)property;
defaultValue = Objects.toString(integerProperty.getDefault(), "");
}
else if(property instanceof LongProperty){
LongProperty longProperty = (LongProperty)property;
defaultValue = Objects.toString(longProperty.getDefault(), "");
}
else if(property instanceof UUIDProperty){
UUIDProperty uuidProperty = (UUIDProperty)property;
defaultValue = Objects.toString(uuidProperty.getDefault(), "");
}
return defaultValue;
}
开发者ID:buremba,项目名称:swagger-slate,代码行数:30,代码来源:PropertyUtils.java
示例9: mapTupleValue
import io.swagger.models.properties.DoubleProperty; //导入依赖的package包/类
@Override
public Double mapTupleValue(@NonNull DoubleProperty schema, @NonNull ValueContext valueContext) {
return SchemaMapperUtils.castLiteralValue(valueContext.getValue()).doubleValue();
}
开发者ID:dotwebstack,项目名称:dotwebstack-framework,代码行数:5,代码来源:DoubleSchemaMapper.java
示例10: supports
import io.swagger.models.properties.DoubleProperty; //导入依赖的package包/类
@Override
public boolean supports(@NonNull Property schema) {
return schema instanceof DoubleProperty;
}
开发者ID:dotwebstack,项目名称:dotwebstack-framework,代码行数:5,代码来源:DoubleSchemaMapper.java
注:本文中的io.swagger.models.properties.DoubleProperty类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论