/** * Check for negative value and throw IllegalArgumentException if negative. * * @param object value to check * @param message message for the illegal argument exception * @throws IllegalArgumentException if object is negative */ public static void checkNotNegative(@Nonnegative long object, String message) { checkNotNegative(object, () -> message); }
/** * Check for negative value and throw IllegalArgumentException if negative. * * @param object value to check * @throws IllegalArgumentException if object is negative */ public static void checkNotNegative(@Nonnegative long object) { checkNotNegative(object, () -> "this variable cannot be negative: " + object); }
/** * Check for negative value and throw IllegalArgumentException if negative. * * @param object value to check * @param message message for the illegal argument exception * @throws IllegalArgumentException if object is negative */ public static void checkNotNegative(@Nonnegative long object, String message) { checkNotNegative(object, () -> message); }
/** * Check for negative value and throw IllegalArgumentException if negative. * * @param object value to check * @throws IllegalArgumentException if object is negative */ public static void checkNotNegative(@Nonnegative long object) { checkNotNegative(object, () -> "this variable cannot be negative: " + object); }
@Override public OWLObjectMinCardinality getOWLObjectMinCardinality(int cardinality, OWLObjectPropertyExpression property) { checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); return new OWLObjectMinCardinalityImpl(property, cardinality, OWL_THING); }
@Override public OWLObjectExactCardinality getOWLObjectExactCardinality(int cardinality, OWLObjectPropertyExpression property) { checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); return new OWLObjectExactCardinalityImpl(property, cardinality, OWL_THING); }
@Override public OWLObjectMinCardinality getOWLObjectMinCardinality(int cardinality, OWLObjectPropertyExpression property) { checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); return new OWLObjectMinCardinalityImpl(property, cardinality, OWL_THING); }
@Override public OWLObjectMaxCardinality getOWLObjectMaxCardinality(int cardinality, OWLObjectPropertyExpression property) { checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); return new OWLObjectMaxCardinalityImpl(property, cardinality, OWL_THING); }
@Override public OWLDataMinCardinality getOWLDataMinCardinality(int cardinality, OWLDataPropertyExpression property) { checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); return new OWLDataMinCardinalityImpl(property, cardinality, getTopDatatype()); }
@Override public OWLDataExactCardinality getOWLDataExactCardinality(int cardinality, OWLDataPropertyExpression property, OWLDataRange dataRange) { checkNotNull(dataRange, DATA_RANGE_CANNOT_BE_NULL); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); return new OWLDataExactCardinalityImpl(property, cardinality, dataRange); }
@Override public OWLDataMinCardinality getOWLDataMinCardinality(int cardinality, OWLDataPropertyExpression property, OWLDataRange dataRange) { checkNotNull(dataRange, DATA_RANGE_CANNOT_BE_NULL); checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); return new OWLDataMinCardinalityImpl(property, cardinality, dataRange); }
@Override public OWLObjectExactCardinality getOWLObjectExactCardinality(int cardinality, OWLObjectPropertyExpression property, OWLClassExpression classExpression) { checkNotNull(classExpression, CLASS_EXPRESSION_CANNOT_BE_NULL); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); return new OWLObjectExactCardinalityImpl(property, cardinality, classExpression); }
@Override public OWLDataExactCardinality getOWLDataExactCardinality(int cardinality, OWLDataPropertyExpression property, OWLDataRange dataRange) { checkNotNull(dataRange, DATA_RANGE_CANNOT_BE_NULL); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); return new OWLDataExactCardinalityImpl(property, cardinality, dataRange); }
@Override public OWLDataMinCardinality getOWLDataMinCardinality(int cardinality, OWLDataPropertyExpression property, OWLDataRange dataRange) { checkNotNull(dataRange, DATA_RANGE_CANNOT_BE_NULL); checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); return new OWLDataMinCardinalityImpl(property, cardinality, dataRange); }
@Override public OWLDataMaxCardinality getOWLDataMaxCardinality(int cardinality, OWLDataPropertyExpression property) { checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); return new OWLDataMaxCardinalityImpl(property, cardinality, getTopDatatype()); }
@Override public OWLObjectExactCardinality getOWLObjectExactCardinality(int cardinality, OWLObjectPropertyExpression property, OWLClassExpression classExpression) { checkNotNull(classExpression, CLASS_EXPRESSION_CANNOT_BE_NULL); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); return new OWLObjectExactCardinalityImpl(property, cardinality, classExpression); }
@Override public OWLDataExactCardinality getOWLDataExactCardinality(int cardinality, OWLDataPropertyExpression property) { checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); return new OWLDataExactCardinalityImpl(property, cardinality, getTopDatatype()); }
@Override public OWLObjectMinCardinality getOWLObjectMinCardinality(int cardinality, OWLObjectPropertyExpression property, OWLClassExpression classExpression) { checkNotNull(classExpression, CLASS_EXPRESSION_CANNOT_BE_NULL); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); return new OWLObjectMinCardinalityImpl(property, cardinality, classExpression); }
@Override public OWLDataExactCardinality getOWLDataExactCardinality(int cardinality, OWLDataPropertyExpression property) { checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); return new OWLDataExactCardinalityImpl(property, cardinality, getTopDatatype()); }
@Override public OWLDataExactCardinality getOWLDataExactCardinality(int cardinality, OWLDataPropertyExpression property, OWLDataRange dataRange) { checkNotNull(dataRange, DATA_RANGE_CANNOT_BE_NULL); checkNotNull(property, PROPERTY_CANNOT_BE_NULL); checkNotNegative(cardinality, CARDINALITY_CANNOT_BE_NEGATIVE); return new OWLDataExactCardinalityImpl(property, cardinality, dataRange); }