@Override protected BooleanProperty create() { return new BooleanProperty(); }
/** * Retrieves the default value of a property * * @return the default value of the property */ public Optional<Object> getDefaultValue() { if (property instanceof BooleanProperty) { BooleanProperty booleanProperty = (BooleanProperty) property; return Optional.ofNullable(booleanProperty.getDefault()); } else if (property instanceof StringProperty) { StringProperty stringProperty = (StringProperty) property; return Optional.ofNullable(stringProperty.getDefault()); } else if (property instanceof DoubleProperty) { DoubleProperty doubleProperty = (DoubleProperty) property; return Optional.ofNullable(doubleProperty.getDefault()); } else if (property instanceof FloatProperty) { FloatProperty floatProperty = (FloatProperty) property; return Optional.ofNullable(floatProperty.getDefault()); } else if (property instanceof IntegerProperty) { IntegerProperty integerProperty = (IntegerProperty) property; return Optional.ofNullable(integerProperty.getDefault()); } else if (property instanceof LongProperty) { LongProperty longProperty = (LongProperty) property; return Optional.ofNullable(longProperty.getDefault()); } else if (property instanceof UUIDProperty) { UUIDProperty uuidProperty = (UUIDProperty) property; return Optional.ofNullable(uuidProperty.getDefault()); } return Optional.empty(); }
public void setDefault(String _default) { this._default(_default); }
@Override public Model getCREATEModel(Representation rep) { return ((ModelImpl) super.getCREATEModel(rep)) .property("format", new StringProperty().example("java.lang.String")) .property("foreignKey", new IntegerProperty()) .property("sortWeight", new DoubleProperty()) .property("searchable", new BooleanProperty()._default(false)) .property("editPrivilege", new RefProperty("#/definitions/PrivilegeCreate")) .required("description"); }
@Override public Model getCREATEModel(Representation rep) { return ((ModelImpl) super.getCREATEModel(rep)) .property("retired", new BooleanProperty()) .property("retiredReason", new StringProperty()); }
@Override public Model getCREATEModel(Representation rep) { return new ModelImpl() .property("orderType", new ObjectProperty() .property("uuid", new StringProperty())) .property("orderTemplate", new StringProperty()) .property("concept", new StringProperty().example("uuid")) .property("retired", new BooleanProperty()); }
if (byte.class == objectClass || Byte.class == objectClass) { swaggerProperty = new StringProperty("byte"); } else if (char.class == objectClass || Character.class == objectClass) { StringProperty property = new StringProperty(); property.setMaxLength(1); swaggerProperty = property; } else if (short.class == objectClass || Short.class == objectClass) { } else if (long.class == objectClass || Long.class == objectClass) { swaggerProperty = new LongProperty(); } else if (float.class == objectClass || Float.class == objectClass) { swaggerProperty = new FloatProperty(); } else if (double.class == objectClass || Double.class == objectClass) { swaggerProperty = new DoubleProperty(); } else if (BigDecimal.class == objectClass) { } else if (boolean.class == objectClass || Boolean.class == objectClass) { swaggerProperty = new BooleanProperty(); } else if (String.class == objectClass) {
return new StringProperty() .required(annotation.required()) .example(annotation.example().isEmpty() ? null : annotation.example()) .description(annotation.value().isEmpty() ? null : annotation.value()); DoubleProperty property = new DoubleProperty(); property.setRequired(annotation.required()); return property .example(annotation.example()) .description(annotation.value()); FloatProperty property = new FloatProperty(); property.setRequired(annotation.required()); return property .example(annotation.example()) .description(annotation.value()); IntegerProperty property = new IntegerProperty(); property.setRequired(annotation.required()); property.setExample(annotation.example()); return property .description(annotation.value()); BooleanProperty property = new BooleanProperty(); property.setRequired(annotation.required()); property.setExample(annotation.example()); return property .description(annotation.value());
private static Map<String, Property> initProperties() { Map<String, Property> properties = new LinkedHashMap<>(); properties.put(PROPERTY_ONE_NAME, new StringProperty() .example(PROPERTY_ONE_EXAMPLE) .required(true) .description(PROPERTY_ONE_DESCRIPTION)); properties.put(PROPERTY_TWO_NAME, new StringProperty() .example(PROPERTY_TWO_EXAMPLE) .required(true) .description(PROPERTY_TWO_DESCRIPTION)); IntegerProperty integerProp = new IntegerProperty(); LongProperty longProp = new LongProperty(); BooleanProperty booleanProp = new BooleanProperty(); integerProp.setExample(""); longProp.setExample(""); booleanProp.setExample(""); properties.put(ARRAY_PROP_NAME, new ArrayProperty().example("").description("")); properties.put(DOUBLE_PROP_NAME, new DoubleProperty().example("").description("")); properties.put(FLOAT_PROP_NAME, new FloatProperty().example("").description("")); properties.put(INTEGER_PROP_NAME, integerProp.description("")); properties.put(LONG_PROP_NAME, longProp.description("")); properties.put(BOOLEAN_PROP_NAME, booleanProp.description("")); properties.put(OBJECT_PROP_NAME, new ObjectProperty().example("").description("")); return properties; } }
@Override public Model getCREATEModel(Representation rep) { return new ModelImpl() .property("givenName", new StringProperty()) .property("middleName", new StringProperty()) .property("familyName", new StringProperty()) .property("familyName2", new StringProperty()) .property("preferred", new BooleanProperty()._default(false)) .property("prefix", new StringProperty()) .property("familyNamePrefix", new StringProperty()) .property("familyNameSuffix", new StringProperty()) .property("degree", new StringProperty()) .required("givenName").required("familyName"); }
if (_contains) { _matched=true; _switchResult = new StringProperty(); _switchResult = new BooleanProperty(); if (Objects.equal(typeName, "double")) { _matched=true; _switchResult = new DoubleProperty(); if (Objects.equal(typeName, "float")) { _matched=true; _switchResult = new FloatProperty(); if (Objects.equal(typeName, "integer")) { _matched=true; _switchResult = new IntegerProperty(); if (Objects.equal(typeName, "int")) { _matched=true; _switchResult = new IntegerProperty(); if (Objects.equal(typeName, "long")) { _matched=true; _switchResult = new LongProperty();
protected Property getPrimitiveProperty(String type) { String primitiveType = type; if (type.contains(".")) { primitiveType = primitiveType.substring(primitiveType.lastIndexOf(".") + 1).toLowerCase(); } switch (primitiveType) { case "boolean": return new BooleanProperty().example(true); case "float": case "double": return new DoubleProperty().example("3.14"); case "byte": case "short": case "int": case "integer": return new IntegerProperty().example(42); case "long": return new LongProperty().example(Long.MAX_VALUE >> 4); case "date": return new DateProperty().example("2005-14-10T13:17:42.16Z"); case "uuid": UUIDProperty uuidProp = new UUIDProperty(); uuidProp.setExample("19474a3b-99b5-482e-9e77-852be9adf817"); return uuidProp; case "string": return new StringProperty().example("String"); default: return null; } }
property = new StringProperty(); break; case "boolean": property = new BooleanProperty(); break; case "array": case "number": case "integer": property = new IntegerProperty(); break; default:
private Property makeProperty(PropertyDescription pd) { switch (pd.typeName) { case BOOLEAN: return new BooleanProperty(); case BYTES: return new BinaryProperty(); 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 new StringProperty(); case InternetAddressV6: return new StringProperty(); case LONG: return new LongProperty(); case MAP: return new MapProperty(new StringProperty());
output = new StringExample(example.toString()); } else { String defaultValue = ((StringProperty)property).getDefault(); List<String> enums = ((StringProperty) property).getEnum(); if( enums != null && !enums.isEmpty()) { defaultValue = enums.get(0); Integer defaultValue = ((IntegerProperty) property).getDefault(); List<Integer> enums = ((IntegerProperty) property).getEnum(); if( enums != null && !enums.isEmpty()) { defaultValue = enums.get(0); Long defaultValue = ((LongProperty) property).getDefault(); List<Long> enums = ((LongProperty) property).getEnum(); if( enums != null && !enums.isEmpty()) { defaultValue = enums.get(0); Float defaultValue = ((FloatProperty) property).getDefault(); Double defaultValue = ((DoubleProperty) property).getDefault(); Boolean defaultValue = ((BooleanProperty)property).getDefault(); output = new BooleanExample( defaultValue == null ? SAMPLE_BOOLEAN_PROPERTY_VALUE : defaultValue.booleanValue());
defProperty = new BooleanProperty(); } else if (BluePrintConstants.DATA_TYPE_INTEGER.equals(propertyDefinition.getType())) { StringProperty stringProperty = new StringProperty(); stringProperty.setType("integer"); defProperty = stringProperty; } else if (BluePrintConstants.DATA_TYPE_FLOAT.equals(propertyDefinition.getType())) { StringProperty stringProperty = new StringProperty(); stringProperty.setFormat("float"); defProperty = stringProperty;
public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { modelImpl .property("isSet", new BooleanProperty()._default(false)); } return modelImpl; }
private Object getAttribute(final BooleanProperty prop, final String attr) { Object _xblockexpression = null; { Boolean _switchResult = null; if (attr != null) { switch (attr) { case "default": _switchResult = prop.getDefault(); break; } } final Boolean value = _switchResult; Object _elvis = null; if (value != null) { _elvis = value; } else { Object _attribute = this.getAttribute(((AbstractProperty) prop), attr); _elvis = _attribute; } _xblockexpression = _elvis; } return _xblockexpression; }
@Override public Model getCREATEModel(Representation rep) { return new ModelImpl() .property("name", new StringProperty()) .property("locale", new StringProperty().example("en")) .property("localePreferred", new BooleanProperty()._default(false)) .property("conceptNameType", new EnumProperty(ConceptNameType.class)) .required("name").required("locale"); }
@Override public Model getUPDATEModel(Representation rep) { return new ModelImpl() .property("encounterRole", new StringProperty()) .property("voided", new BooleanProperty()) .property("voidReason", new StringProperty()); }