public AbstractNumericProperty minimum(BigDecimal minimum) { this.setMinimum(minimum); return this; }
Range range = (Range) annos.get("org.hibernate.validator.constraints.Range"); AbstractNumericProperty ap = (AbstractNumericProperty) property; ap.setMinimum(new BigDecimal(range.min())); ap.setMaximum(new BigDecimal(range.max()));
protected <N extends AbstractNumericProperty> N mergeNumeric(N property, Map<PropertyId, Object> args) { if (args.containsKey(PropertyId.MINIMUM)) { final BigDecimal value = PropertyId.MINIMUM.findValue(args); if(value != null) { property.setMinimum(value); } } if (args.containsKey(PropertyId.MAXIMUM)) { final BigDecimal value = PropertyId.MAXIMUM.findValue(args); if(value != null) { property.setMaximum(value); } } if (args.containsKey(PropertyId.EXCLUSIVE_MINIMUM)) { final Boolean value = PropertyId.EXCLUSIVE_MINIMUM.findValue(args); property.setExclusiveMinimum(value); } if (args.containsKey(PropertyId.EXCLUSIVE_MAXIMUM)) { final Boolean value = PropertyId.EXCLUSIVE_MAXIMUM.findValue(args); property.setExclusiveMaximum(value); } if (args.containsKey(PropertyId.MULTIPLE_OF)) { final BigDecimal value = PropertyId.MULTIPLE_OF.findValue(args); if(value != null) { property.setMultipleOf(value); } } return property; }
String _minValue_1 = it.getMinValue(); BigDecimal _bigDecimal = new BigDecimal(_minValue_1); ((AbstractNumericProperty)property).setMinimum(_bigDecimal); ((AbstractNumericProperty)property).setExclusiveMinimum(Boolean.valueOf(it.isMinValueExclusive()));
if (methodParameter.isAnnotationPresent(Min.class)) { Min min = methodParameter.getAnnotation(Min.class); numericProperty.setMinimum(BigDecimal.valueOf(min.value())); numericProperty.setMinimum(BigDecimal.valueOf(range.min())); numericProperty.setMaximum(BigDecimal.valueOf(range.max()));
if (methodParameter.isAnnotationPresent(Min.class)) { Min min = methodParameter.getAnnotation(Min.class); numericProperty.setMinimum(BigDecimal.valueOf(min.value())); numericProperty.setMinimum(BigDecimal.valueOf(range.min())); numericProperty.setMaximum(BigDecimal.valueOf(range.max()));
if (schema instanceof AbstractNumericProperty) { (((AbstractNumericProperty) schema)) .setMinimum(new BigDecimal(validatorDescriptor.getMin().doubleValue())); (((AbstractNumericProperty) schema)).setExclusiveMinimum(validatorDescriptor.isExclusiveMin()); } else if (schema instanceof StringProperty) {
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; numericProperty.setMaximum(modelImpl.getMaximum()); numericProperty.setMinimum(modelImpl.getMinimum()); numericProperty.setMultipleOf(modelImpl.getMultipleOf()); numericProperty.setExclusiveMinimum(modelImpl.getExclusiveMinimum());