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

io.hyperfoil.api.session.AccessVisitor Maven / Gradle / Ivy

There is a newer version: 0.27
Show newest version
package io.hyperfoil.api.session;

import java.util.ArrayList;

import io.hyperfoil.impl.CollectingVisitor;

public class AccessVisitor extends CollectingVisitor {
   private final ArrayList reads = new ArrayList<>();
   private final ArrayList writes = new ArrayList<>();

   public AccessVisitor() {
      super(ReadAccess.class);
   }

   @Override
   protected boolean process(ReadAccess value) {
      reads.add(value);
      if (value instanceof WriteAccess) {
         writes.add((WriteAccess) value);
      }
      return false;
   }

   public ReadAccess[] reads() {
      return reads.toArray(new ReadAccess[0]);
   }

   public WriteAccess[] writes() {
      return writes.toArray(new WriteAccess[0]);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy