Class DefaultKeySizeConstraint

  • All Implemented Interfaces:
    Constraint

    public class DefaultKeySizeConstraint
    extends Object
    implements Constraint
    A constraints that limits the size of keys to 1mb.
    • Constructor Detail

      • DefaultKeySizeConstraint

        public DefaultKeySizeConstraint()
    • Method Detail

      • getViolationDescription

        public String getViolationDescription​(short violationCode)
        Description copied from interface: Constraint
        Gets a short, one-sentence description of what a given violation code means.
        Specified by:
        getViolationDescription in interface Constraint
        Parameters:
        violationCode - numeric violation code
        Returns:
        matching violation description
      • check

        public List<Short> check​(Constraint.Environment env,
                                 Mutation mutation)
        Description copied from interface: Constraint
        Checks a mutation for constraint violations. If the mutation contains no violations, returns null. Otherwise, returns a list of violation codes. Violation codes must be non-negative. Negative violation codes are reserved for system use.
        Specified by:
        check in interface Constraint
        Parameters:
        env - constraint environment
        mutation - mutation to check
        Returns:
        list of violation codes, or null if none