Get an {@link Enumeration} object based on a {@link Collection} object.

@param <ELEMENTTYPE>
the type of the elements in the container
@param aCont
The container to enumerate.
@return an Enumeration object
503872
@Nonnull
  public static <ELEMENTTYPE> Enumeration <ELEMENTTYPE> getEnumeration (@Nullable final Iterable <ELEMENTTYPE> aCont)
  {
    return CollectionHelper.isEmpty (aCont) ? new EmptyEnumeration <> () : getEnumeration (aCont.iterator ());
  }
311155
public static <E> Bindable<Set<E>> setOf(Class<E> elementType) {
		return of(ResolvableType.forClassWithGenerics(Set.class, elementType));
	}
120516
public static <T extends Enum<T>> T getEnum(PropertyKey key, Class<T> enumType) {
    return sConf.getEnum(key, enumType);
  }
225520
public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
        Annotation value = annotations.get(annotationType);
        return annotationType.cast(value);
    }
605264
public static <E extends Enum<E>> StreamableEnumSet<E> range (E from, E to)
    {
        Class<E> elementType = from.getDeclaringClass();
        StreamableEnumSet<E> set = new StreamableEnumSet<E>(elementType);
        E[] constants = elementType.getEnumConstants();
        for (int ii = from.ordinal(), last = to.ordinal(); ii <= last; ii++) {
            set.add(constants[ii]);
        }
        return set;
    }
313462
@Nonnull
  public JSFormatter generatable (@Nonnull final Iterable <? extends IJSGeneratable> aCont)
  {
    boolean bFirst = true;
    for (final IJSGeneratable aItem : aCont)
    {
      if (bFirst)
        bFirst = false;
      else
        plain (',');
      generatable (aItem);
    }
    return this;
  }
639989
public static <T> TypeChecker<Collection<? extends T>> tCollection(Class<? extends T> elementType) {
        return tCollection(tSimple(elementType));
    }
98511
public static <E extends Enum<E>> Collector<E, ?, EnumSet<E>> toEnumSet(Class<E> enumClass) {
    return Collectors.toCollection(() -> EnumSet.noneOf(enumClass));
  }
594523
public Enumeration getValues(String name)
    {
        FieldInfo info=getFieldInfo(name);
        final Field field=getField(info,true);

        if (field!=null)
        {            
            return new Enumeration()
                {
                    Field f=field;
                    
                    public boolean hasMoreElements()
                    {
                        while (f!=null && f._version!=_version)
                            f=f._next;
                        return f!=null;
                    }
                        
                    public Object nextElement()
                        throws NoSuchElementException
                    {
                        if (f==null)
                            throw new NoSuchElementException();
                        Field n=f;
                        do f=f._next; while (f!=null && f._version!=_version);
                        return n._value;
                    }
                };
        }
        return null;
    }
431406
public static Collection<?> toCollection(Class<?> collectionType, Class<?> elementType, Object value) {
		return new CollectionConverter(collectionType, elementType).convert(value, null);
	}
316886
public static <T extends AnnotationDescription> ElementMatcher.Junction<T> annotationType(ElementMatcher<? super TypeDescription> matcher) {
        return new AnnotationTypeMatcher<T>(matcher);
    }
236249
public List<ElementType<AnnotationType<T>>> getAllElement()
   {
      List<ElementType<AnnotationType<T>>> list = new ArrayList<ElementType<AnnotationType<T>>>();
      List<Node> nodeList = childNode.get("element");
      for(Node node: nodeList)
      {
         ElementType<AnnotationType<T>>  type = new ElementTypeImpl<AnnotationType<T>>(this, "element", childNode, node);
         list.add(type);
      }
      return list;
   }
530905
public <T extends Annotation> T getMethodAnnotation(Class<T> annotationType) {
		return getAnnotatedElement().getAnnotation(annotationType);
	}
1070067
public <T extends Enum<T>> T readEnum(Class<T> enumType) throws IOException {
		try {
			return Enum.valueOf(enumType, readUTF());
		} catch(IllegalArgumentException err) {
			throw new IOException(err);
		}
	}
149520
public static <T> TypeChecker<List<? extends T>> tList(Class<? extends T> elementType) {
        return tList(tSimple(elementType));
    }
777115
@Override
    @SuppressWarnings("rawtypes")
    public Enumeration getEnumeration(Finder finder)
                    throws FinderException,
                    RemoteException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2

        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "getEnumeration(EJSFinder)");

        homeEnabled();

        final ContainerTx currentTx = container.getCurrentContainerTx();//d171654
        Enumeration rtnEnum =
                        container.persisterFactory.wrapResultsInEnumeration(currentTx,
                                                                            this,
                                                                            finder);
        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "getEnumeration");

        return rtnEnum;
    }
435869
public static <A extends Annotation> A getAnnotation(final Method method, final Class<A> annotationType) {
        A ann = method.getAnnotation(annotationType);
        if (ann == null) {
            for (final Annotation metaAnn : method.getAnnotations()) {
                ann = metaAnn.annotationType().getAnnotation(annotationType);
                if (ann != null) {
                    break;
                }
            }
        }
        return ann;
    }