All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.galasa.framework.spi.ras.RasSearchCriteriaStatus Maven / Gradle / Ivy

There is a newer version: 0.37.0
Show newest version
/*
 * Copyright contributors to the Galasa project
 *
 * SPDX-License-Identifier: EPL-2.0
 */
package dev.galasa.framework.spi.ras;

import java.util.ArrayList;
import java.util.List;

import javax.validation.constraints.NotNull;

import dev.galasa.framework.TestRunLifecycleStatus;
import dev.galasa.framework.spi.teststructure.TestStructure;

public class RasSearchCriteriaStatus implements IRasSearchCriteria {
   
   private final List statuses;
   
   public RasSearchCriteriaStatus(@NotNull List statuses) {
      this.statuses = statuses;
   }
   
   @Override
   public boolean criteriaMatched(@NotNull TestStructure structure) {
      
      for(TestRunLifecycleStatus status : statuses) {
            if(status.toString().equals(structure.getStatus())){
               return true;
            }
      }
      return false;
   }

   public List getStatuses() {
      return this.statuses;
   }

   public String[] getStatusesAsStrings() {
      List statusesStrings = new ArrayList();
      for (TestRunLifecycleStatus status : this.statuses){
         statusesStrings.add(status.toString());
      }
      return statusesStrings.toArray(new String[0]);
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy