Package org.wildfly.naming.client
Interface CloseableNamingEnumeration<T>
- All Superinterfaces:
AutoCloseable,Enumeration<T>,NamingCloseable,NamingEnumeration<T>
A naming enumeration which works with
try-with-resources.- Author:
- David M. Lloyd
-
Field Summary
FieldsFields inherited from interface org.wildfly.naming.client.NamingCloseable
NULL -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the enumeration.static <T> CloseableNamingEnumeration<T>empty()static <T> CloseableNamingEnumeration<T>fromEnumeration(Enumeration<T> enumeration) Create a naming enumeration from a collection enumeration.static <T> CloseableNamingEnumeration<T>fromEnumeration(NamingEnumeration<T> enumeration) Create a closeable naming enumeration from a naming enumeration.static <T> CloseableNamingEnumeration<T>fromIterable(Iterable<T> iterable) Create a naming enumeration from an iterable collection.static <T> CloseableNamingEnumeration<T>fromIterator(Iterator<T> iterator) Create a naming enumeration from a collection iterator.Methods inherited from interface java.util.Enumeration
asIterator, hasMoreElements, nextElementMethods inherited from interface javax.naming.NamingEnumeration
hasMore, next
-
Field Details
-
EMPTY
-
-
Method Details
-
close
Close the enumeration.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceNamingCloseable- Specified by:
closein interfaceNamingEnumeration<T>- Throws:
NamingException- if closing the enumeration failed for some reason
-
fromIterable
Create a naming enumeration from an iterable collection.- Type Parameters:
T- the element type- Parameters:
iterable- the iterable- Returns:
- the enumeration
-
fromIterator
Create a naming enumeration from a collection iterator.- Type Parameters:
T- the element type- Parameters:
iterator- the iterator- Returns:
- the enumeration
-
fromEnumeration
Create a naming enumeration from a collection enumeration.- Type Parameters:
T- the element type- Parameters:
enumeration- the enumeration- Returns:
- the enumeration
-
fromEnumeration
Create a closeable naming enumeration from a naming enumeration.- Type Parameters:
T- the element type- Parameters:
enumeration- the enumeration- Returns:
- the enumeration
-
empty
-