Class Constraints


  • public class Constraints
    extends Object
    User table or column constraints
    Since:
    5.0.0
    Author:
    osbornb
    • Constructor Detail

      • Constraints

        public Constraints()
        Constructor
      • Constraints

        public Constraints​(Constraints constraints)
        Copy Constructor
        Parameters:
        constraints - constraints
    • Method Detail

      • add

        public void add​(Constraint constraint)
        Add constraint
        Parameters:
        constraint - constraint
      • add

        public void add​(Collection<Constraint> constraints)
        Add constraints
        Parameters:
        constraints - constraints
      • add

        public void add​(Constraints constraints)
        Add constraints
        Parameters:
        constraints - constraints
      • has

        public boolean has()
        Check if has constraints
        Returns:
        true if has constraints
      • has

        public boolean has​(ConstraintType type)
        Check if has constraints of the provided type
        Parameters:
        type - constraint type
        Returns:
        true if has constraints
      • size

        public int size()
        Get the number of constraints
        Returns:
        size
      • size

        public int size​(ConstraintType type)
        Get the number of constraints of the provided type
        Parameters:
        type - constraint type
        Returns:
        size
      • all

        public List<Constraint> all()
        Get the constraints
        Returns:
        constraints
      • get

        public Constraint get​(int index)
        Get the constraint at the index
        Parameters:
        index - constraint index
        Returns:
        constraint
      • get

        public List<Constraint> get​(ConstraintType type)
        Get the constraints of the provided type
        Parameters:
        type - constraint type
        Returns:
        constraints
      • clear

        public List<Constraint> clear()
        Clear the constraints
        Returns:
        cleared constraints
      • clear

        public List<Constraint> clear​(ConstraintType type)
        Clear the constraints of the provided type
        Parameters:
        type - constraint type
        Returns:
        cleared constraints
      • copy

        public Constraints copy()
        Copy the constraints
        Returns:
        constraints