Fraction Attributes
Attribute type id | Type specific restriction parameters |
---|---|
fraction | minValue: Minimum fraction value (inclusive) |
maxValue: Maximum fraction value (inclusive) | |
patterns: List of patters that the value must match (Java Pattern). Values has to match all the patters. Pattern is only matched against the attribute value - without unit. | |
units: List of possible units to use (units have to be defined in unitsOfMeasure section of datastandard) |
All restrictions are validated in provided order.
Attribute validation will fail on the first unfulfilled restriction.
Accepted are fraction values (i.e. 1/2) and decimal values (i.e. 0.5).
Code Examples:
{
"id" : "WRENCH_HEAD_SIZE_INCH",
"name" : "Wrench Head Size (inch)",
"type" : {
"id" : "fraction",
"restriction" : {
"parameters" : {
"minValue" : "1 / 64",
"maxValue" : "99"
}
}
}
}
Attribute fractionAttribute = AttributeBuilder
.fractionAttribute("WRENCH_HEAD_SIZE_INCH", "Wrench Head Size (inch)")
.withMinValue(BigFraction.getReducedFraction(1, 64))
.withMaxValue(new BigFraction(99))
.build();
Updated over 1 year ago