Class BandwidthConstraint

  • All Implemented Interfaces:
    Constraint

    @Beta
    public final class BandwidthConstraint
    extends BooleanConstraint
    Constraint that evaluates links based on available bandwidths.
    • Constructor Detail

      • BandwidthConstraint

        public BandwidthConstraint​(Bandwidth bandwidth)
        Creates a new bandwidth constraint.
        Parameters:
        bandwidth - required bandwidth
    • Method Detail

      • isValid

        public boolean isValid​(Link link,
                               ResourceContext context)
        Description copied from class: BooleanConstraint
        Returns true if the specified link satisfies the constraint.
        Specified by:
        isValid in class BooleanConstraint
        Parameters:
        link - link to be validated
        context - resource context for checking available resources
        Returns:
        true if link is viable
      • bandwidth

        public Bandwidth bandwidth()
        Returns the bandwidth required by this constraint.
        Returns:
        required bandwidth
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object