public StringProperty maxLength(Integer maxLength) { this.setMaxLength(maxLength); return this; }
protected <N extends StringProperty> N mergeString(N property, Map<PropertyId, Object> args) { if (args.containsKey(PropertyId.DEFAULT)) { final String value = PropertyId.DEFAULT.findValue(args); property.setDefault(value); } if (args.containsKey(PropertyId.MIN_LENGTH)) { final Integer value = PropertyId.MIN_LENGTH.findValue(args); property.setMinLength(value); } if (args.containsKey(PropertyId.MAX_LENGTH)) { final Integer value = PropertyId.MAX_LENGTH.findValue(args); property.setMaxLength(value); } if (args.containsKey(PropertyId.PATTERN)) { final String value = PropertyId.PATTERN.findValue(args); property.setPattern(value); } if (args.containsKey(PropertyId.ENUM)) { final List<String> value = PropertyId.ENUM.findValue(args); property.setEnum(value); } return property; }
((StringProperty)property).setMaxLength(Integer.valueOf(it.getMaxLength()));
property.setMaxLength(1); swaggerProperty = property; } else if (short.class == objectClass || Short.class == objectClass) {
property.setMaxLength(1); swaggerProperty = property; } else if (short.class == objectClass || Short.class == objectClass) {
protected AbstractProperty fillProperty(AbstractProperty property, Framework.Mapping<?> mapping) { property.setDescription(attach(mapping).desc()); property.setFormat(format(mapping)); property.setRequired(required(mapping)); property.setExample(attach(mapping).example()); if (property instanceof AbstractNumericProperty) { AbstractNumericProperty numericProperty = (AbstractNumericProperty) property; numericProperty.setMaximum(maximum(mapping)); numericProperty.setExclusiveMaximum(exclusiveMaximum(mapping)); numericProperty.setMinimum(minimum(mapping)); numericProperty.setExclusiveMinimum(exclusiveMinimum(mapping)); } if (property instanceof StringProperty) { StringProperty stringProperty = (StringProperty) property; stringProperty.setPattern(pattern(mapping)); stringProperty.setEnum(enums(mapping)); stringProperty.setMaxLength(maxLength(mapping)); stringProperty.setMinLength(minLength(mapping)); } return property; }
ModelImpl modelImpl = (ModelImpl) model; stringProperty.setPattern(modelImpl.getPattern()); stringProperty.setMaxLength(modelImpl.getMaxLength()); stringProperty.setMinLength(modelImpl.getMinLength()); return stringProperty;