/** * Defines the value range. The data type of the event property must be a number. * @param min The minimum value the property can have at runtime. * @param max The maximum value the property can have at runtime. * @param step The expected granularity the property has at runtime. * @return this */ public PrimitivePropertyBuilder valueSpecification(Float min, Float max, Float step) { this.eventProperty.setValueSpecification(new QuantitativeValue(min, max, step)); return this; }
/** * Defines the value range in form of an enumeration. The data type of the event property must be of type String * or Number. * @param label A human-readable label describing this enumeration. * @param description A human-readable description of the enumeration. * @param allowedValues A list of allowed values of the event property at runtime. * @return this */ public PrimitivePropertyBuilder valueSpecification(String label, String description, List<String> allowedValues) { this.eventProperty.setValueSpecification(new Enumeration(label, description, allowedValues)); return this; }
public static EventPropertyPrimitive integerEp(Label label, String runtimeName, String domainProperty, QuantitativeValue valueSpecification) { EventPropertyPrimitive ep = ep(label, XSD._integer.toString(), runtimeName, domainProperty); ep.setValueSpecification(valueSpecification); return ep; }
/** * Creates a new primitive property of type string and the provided domain property. In addition, the value range * of the property is restricted to the defined {@link org.streampipes.model.schema.Enumeration} * @param runtimeName The field identifier of the event property at runtime. * @param domainProperty The semantics of the list property as a String. The string should correspond to a URI * provided by a vocabulary. Use one of the vocabularies provided in * {@link org.streampipes.vocabulary} or create your own domain-specific vocabulary. * @param enumeration The allowed values of the event property at runtime. * @return {@link org.streampipes.model.schema.EventPropertyPrimitive} */ public static EventPropertyPrimitive stringEp(Label label, String runtimeName, String domainProperty, Enumeration enumeration) { EventPropertyPrimitive ep = ep(label, XSD._string.toString(), runtimeName, domainProperty); ep.setValueSpecification(enumeration); return ep; }
public static EventPropertyPrimitive doubleEp(Label label, String runtimeName, String domainProperty, Float minValue, Float maxValue, Float step) { EventPropertyPrimitive ep = ep(label, XSD._double.toString(), runtimeName, domainProperty); ep.setValueSpecification(new QuantitativeValue(minValue, maxValue, step)); return ep; }