java.lang.Object
com.dna.jopt.member.unit.condition.workinghour.zone.AbstractZoneCodeConstraint<UKPostCode,UKPostCodeQualification>
com.dna.jopt.member.unit.condition.workinghour.zone.ukpostcode.UKPostCodeConstraint
All Implemented Interfaces:
IConstraint, IWorkingHoursLevelConstraint, IZoneCodeConstraint<UKPostCode,UKPostCodeQualification>, Serializable

public class UKPostCodeConstraint extends AbstractZoneCodeConstraint<UKPostCode,UKPostCodeQualification>
This class allows to add Constraints to Nodes so that only Resources from certain UK postcode areas are allowed to give them service.
Since:
13/09/2019
Version:
13/09/2019
Author:
DNA
See Also:
  • Field Details

  • Constructor Details

    • UKPostCodeConstraint

      public UKPostCodeConstraint()
  • Method Details

    • getTitle

      public String getTitle()
      Description copied from interface: IConstraint
      Gets the title of the constraint.
      Returns:
      the title
    • assessConstraint

      public com.dna.jopt.assessment.costassessorrestriction.restrictionresult.IEntityRestrictionResult assessConstraint(IEntity en, ILogicEntityRoute route, INode node, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster cad, com.dna.jopt.assessment.costassessor.IEntityCostAssessor ca, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, boolean resultRequested)
      Description copied from interface: IConstraint
      Assesses the route, checking if the appropriate qualifications for the constraints are present.

      The boolean true saves the data.

      Parameters:
      en - entity
      route - the iLogicEntityRoute
      node - node
      cad - iEntityCostAdjuster
      ca - ca
      propertyProvider - iPropertyProvider
      resultRequested - the boolean whether to save the results of the route
      Returns:
      Entity Restriction Result
    • matchZoneCodes

      public boolean matchZoneCodes(UKPostCodeQualification quali, List<UKPostCode> masterCodes)
    • matchCodesAndPenalize

      public Optional<IViolation> matchCodesAndPenalize(UKPostCodeQualification quali, List<UKPostCode> masterCodes, ILogicEntityRoute route, com.dna.jopt.assessment.costadjustment.IEntityCostAdjuster cad, com.dna.jopt.framework.inputplausibility.properties.IPropertyProvider propertyProvider, boolean resultRequested)
    • getNodeZoneQualification

      public Optional<UKPostCodeQualification> getNodeZoneQualification(INode node)