001// Generated by delombok at Fri Mar 03 18:26:02 UTC 2023 002package de.cuioss.test.generator.internal.net; 003 004import de.cuioss.test.generator.TypedGenerator; 005import de.cuioss.test.generator.internal.net.java.quickcheck.Generator; 006import lombok.NonNull; 007 008/** 009 * Wrapper for {@link Generator} provided by QuickCheck 010 * 011 * @author Oliver Wolff 012 * @param <T> identifying the type of elements to be generated 013 */ 014public class QuickCheckGeneratorAdapter<T> implements TypedGenerator<T> { 015 @NonNull 016 private final Class<T> type; 017 @NonNull 018 private final Generator<T> generator; 019 020 @Override 021 public T next() { 022 return generator.next(); 023 } 024 025 @java.lang.SuppressWarnings("all") 026 @lombok.Generated 027 public QuickCheckGeneratorAdapter(@NonNull final Class<T> type, @NonNull final Generator<T> generator) { 028 if (type == null) { 029 throw new java.lang.NullPointerException("type is marked non-null but is null"); 030 } 031 if (generator == null) { 032 throw new java.lang.NullPointerException("generator is marked non-null but is null"); 033 } 034 this.type = type; 035 this.generator = generator; 036 } 037 038 @java.lang.Override 039 @java.lang.SuppressWarnings("all") 040 @lombok.Generated 041 public java.lang.String toString() { 042 return "QuickCheckGeneratorAdapter(type=" + this.getType() + ")"; 043 } 044 045 @NonNull 046 @java.lang.SuppressWarnings("all") 047 @lombok.Generated 048 public Class<T> getType() { 049 return this.type; 050 } 051 052 @NonNull 053 @java.lang.SuppressWarnings("all") 054 @lombok.Generated 055 public Generator<T> getGenerator() { 056 return this.generator; 057 } 058}