Package org.hivedb.util.classgen

Source Code of org.hivedb.util.classgen.GeneratePrimitiveCollection

package org.hivedb.util.classgen;

import org.hivedb.util.functional.Generate;
import org.hivedb.util.functional.Generator;
import org.hivedb.util.functional.NumberIterator;

import java.util.Collection;

public class GeneratePrimitiveCollection<F> implements Generator<Collection<F>> {

  private Class<F> collectionItemClazz;
  private int size;
  public GeneratePrimitiveCollection(Class<F> collectionItemClazz, int size)
  {
    this.collectionItemClazz = collectionItemClazz;
    this.size = size;
  }
  @SuppressWarnings("unchecked")
  public Collection<F> generate() {
    return  Generate.create(new GeneratePrimitiveValue<F>(this.collectionItemClazz), new NumberIterator(size));
  }
}
TOP

Related Classes of org.hivedb.util.classgen.GeneratePrimitiveCollection

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.