net.percederberg.mibble.type
Interface Constraint

All Known Implementing Classes:
CompoundConstraint, SizeConstraint, ValueConstraint, ValueRangeConstraint

public interface Constraint

A MIB type constraint.

Since:
2.0

Method Summary
 void initialize(MibLoaderLog log)
          Initializes the constraint.
 boolean isCompatible(MibType type)
          Checks if the specified type is compatible with this constraint.
 boolean isCompatible(MibValue value)
          Checks if the specified value is compatible with this constraint.
 

Method Detail

initialize

public void initialize(MibLoaderLog log)
                throws MibException
Initializes the constraint. This will remove all levels of indirection present, such as references to types or values. No constraint information is lost by this operation. This method may modify this object as a side-effect, and will be called by the MIB loader.

Parameters:
log - the MIB loader log
Throws:
MibException - if an error was encountered during the initialization

isCompatible

public boolean isCompatible(MibType type)
Checks if the specified type is compatible with this constraint.

Parameters:
type - the type to check
Returns:
true if the type is compatible, or false otherwise

isCompatible

public boolean isCompatible(MibValue value)
Checks if the specified value is compatible with this constraint.

Parameters:
value - the value to check
Returns:
true if the value is compatible, or false otherwise