Package org.sonar.java.se.constraint
Interface Constraint
-
- All Known Implementing Classes:
BooleanConstraint
,BytecodeEGWalker.StackValueCategoryConstraint
,CustomUnclosedResourcesCheck.CustomResourceConstraint
,DivisionByZeroCheck.ZeroConstraint
,LocksNotUnlockedCheck.LockConstraint
,ObjectConstraint
,StreamConsumedCheck.StreamPipelineConstraint
,TypedConstraint
,UnclosedResourcesCheck.ResourceConstraint
public interface Constraint
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default Constraint
copyOver(RelationalSymbolicValue.Kind kind)
Return constraint which should be applied to the rhs of the relation, if this constraint is set on the lhs of the relation.default boolean
hasPreciseValue()
default Constraint
inverse()
default boolean
isValidWith(Constraint constraint)
default String
valueAsString()
-
-
-
Method Detail
-
valueAsString
default String valueAsString()
- Returns:
- String representation of value encoded by constraint for purpose of flow message
-
hasPreciseValue
default boolean hasPreciseValue()
- Returns:
- true if value represented by this SV is precisely known.
-
inverse
@Nullable default Constraint inverse()
-
isValidWith
default boolean isValidWith(@Nullable Constraint constraint)
-
copyOver
@Nullable default Constraint copyOver(RelationalSymbolicValue.Kind kind)
Return constraint which should be applied to the rhs of the relation, if this constraint is set on the lhs of the relation.- Parameters:
kind
- kind of relation over which constraint is copied- Returns:
- constraint to be set on rhs, null if no constraint should be set
-
-