Enum CollectionSize

  • All Implemented Interfaces:
    Feature<java.util.Collection>, java.io.Serializable, java.lang.Comparable<CollectionSize>

    @GwtCompatible
    public enum CollectionSize
    extends java.lang.Enum<CollectionSize>
    implements Feature<java.util.Collection>, java.lang.Comparable<CollectionSize>
    When describing the features of the collection produced by a given generator (i.e. in a call to FeatureSpecificTestSuiteBuilder.withFeatures(Feature...)), this annotation specifies each of the different sizes for which a test suite should be built. (In a typical case, the features should include ANY.) These semantics are thus a little different from those of other Collection-related features such as CollectionFeature or SetFeature.

    However, when CollectionSize.Require is used to annotate a test it behaves normally (i.e. it requires the collection instance under test to be a certain size for the test to run). Note that this means a test should not require more than one CollectionSize, since a particular collection instance can only be one size at once.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  CollectionSize.Require  
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ANY  
      ONE
      Test a one-element collection.
      SEVERAL
      Test a three-element collection.
      ZERO
      Test an empty collection.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<Feature<? super java.util.Collection>> getImpliedFeatures()
      Returns the set of features that are implied by this feature.
      int getNumElements()  
      static CollectionSize valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static CollectionSize[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Comparable

        compareTo
    • Method Detail

      • values

        public static CollectionSize[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CollectionSize c : CollectionSize.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CollectionSize valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getImpliedFeatures

        public java.util.Set<Feature<? super java.util.Collection>> getImpliedFeatures()
        Description copied from interface: Feature
        Returns the set of features that are implied by this feature.
        Specified by:
        getImpliedFeatures in interface Feature<java.util.Collection>
      • getNumElements

        public int getNumElements()