daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package domain;
  2.  
  3. import org.optaplanner.core.api.domain.entity.PlanningEntity;
  4. import org.optaplanner.core.api.domain.solution.drools.ProblemFactCollectionProperty;
  5. import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider;
  6. import org.optaplanner.core.api.domain.variable.PlanningVariable;
  7.  
  8. import java.util.ArrayList;
  9. import java.util.List;
  10.  
  11. @PlanningEntity
  12. public class ServiceProvider {
  13.  
  14.     @ValueRangeProvider(id = "optionsRange")
  15.     @ProblemFactCollectionProperty
  16.     private List<SPOption> spOptions;
  17.  
  18.     @PlanningVariable(valueRangeProviderRefs = {"optionsRange"})
  19.     private SPOption choosedOption;
  20.  
  21.     public ServiceProvider(List<SPOption> spOptions) {
  22.         this.spOptions = spOptions;
  23.     }
  24.  
  25.     public ServiceProvider() {
  26.         this.spOptions = new ArrayList<SPOption>();
  27.     }
  28.  
  29.     public SPOption getChoosedOption() {
  30.         return choosedOption;
  31.     }
  32.  
  33.     public void setChoosedOption(SPOption choosedOption) {
  34.         this.choosedOption = choosedOption;
  35.     }
  36.  
  37.     public List<SPOption> getSpOptions() {
  38.         return spOptions;
  39.     }
  40.  
  41.     public ServiceProvider addOption(SPOption o) { spOptions.add(o); return this; }
  42.  
  43.     @Override
  44.     public String toString() {
  45.         return "ServiceProvider{" +
  46.                 "choosedOption=" + choosedOption +
  47.                 '}';
  48.     }
  49. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top