public OfferRequirement(String taskType,Collection<TaskInfo> taskInfos,Optional<ExecutorInfo> executorInfoOptional,Optional<PlacementRuleGenerator> placementRuleGeneratorOptional) throws InvalidRequirementException {
  this.taskType=taskType;
  this.taskRequirements=getTaskRequirementsInternal(taskInfos);
  this.executorRequirementOptional=executorInfoOptional.isPresent() ? Optional.of(ExecutorRequirement.create(executorInfoOptional.get())) : Optional.empty();
  this.placementRuleGeneratorOptional=placementRuleGeneratorOptional;
}

public OfferRequirement ( String taskType , Collection < TaskInfo > taskInfos , Optional < ExecutorInfo > executorInfoOptional , Optional < PlacementRuleGenerator > placementRuleGeneratorOptional ) throws InvalidRequirementException { this . taskType = taskType ; this . taskRequirements = getTaskRequirementsInternal ( taskInfos ) ; this . executorRequirementOptional = executorInfoOptional . isPresent ( ) ? Optional . of ( ExecutorRequirement . create ( executorInfoOptional . get ( ) ) ) : Optional . empty ( ) ; this . placementRuleGeneratorOptional = placementRuleGeneratorOptional ; }
creates a new offerrequirement .
