T
- The entry type.public final class ASet<T> extends LinkedHashSet<T>
LinkedHashSet
.
Provides various convenience methods for creating and populating a set with minimal code.
Constructor and Description |
---|
ASet()
Constructor.
|
ASet(Collection<T> c)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
ASet<T> |
a(T... t)
Add.
|
ASet<T> |
a(T t)
Add.
|
ASet<T> |
aa(Collection<? extends T> c)
Add all.
|
ASet<T> |
aif(boolean b,
T t)
Add if.
|
ASet<T> |
aifnn(T... t)
Add if not null.
|
<T2> T2[] |
asArrayOf(Class<T2> c)
Convert the contents of this set into a new array.
|
String |
asString()
Convert to Simplified JSON.
|
String |
asString(WriterSerializer ws)
Convert to a string using the specified serializer.
|
static <T> ASet<T> |
of(Collection<T> c)
Convenience method for creating a list of objects.
|
static <T> ASet<T> |
of(T... t)
Convenience method for creating a list of objects.
|
String |
toString()
Convert to Simplified JSON.
|
Set<T> |
unmodifiable()
Returns an unmodifiable view of this set.
|
static <T> Set<T> |
unmodifiable(Collection<T> c)
Convenience method for creating an unmodifiable sert out of the specified collection.
|
static <T> Set<T> |
unmodifiable(T... t)
Convenience method for creating an unmodifiable set of objects.
|
spliterator
add, clear, clone, contains, isEmpty, iterator, remove, size
equals, hashCode, removeAll
addAll, containsAll, retainAll, toArray, toArray
finalize, getClass, notify, notifyAll, wait, wait, wait
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
parallelStream, removeIf, stream
public ASet()
public ASet(Collection<T> c)
c
- Initial contents. Can be @SafeVarargs public static <T> ASet<T> of(T... t)
t
- The initial values.public static <T> ASet<T> of(Collection<T> c)
c
- The initial values.public static <T> Set<T> unmodifiable(T... t)
t
- The initial values.public static <T> Set<T> unmodifiable(Collection<T> c)
T
- The element type.c
- The collection to add.public ASet<T> a(T t)
Adds an entry to this set.
t
- The entry to add to this set.public ASet<T> a(T... t)
Adds multiple entries to this set.
t
- The entries to add to this set.public ASet<T> aa(Collection<? extends T> c)
Adds multiple entries to this set.
c
- The entries to add to this set.public ASet<T> aif(boolean b, T t)
Adds a value to this set if the boolean value is
b
- The boolean value.t
- The value to add.public ASet<T> aifnn(T... t)
Adds entries to this set skipping
t
- The objects to add to the list.public Set<T> unmodifiable()
public <T2> T2[] asArrayOf(Class<T2> c)
c
- The component type of the array.public String asString(WriterSerializer ws)
ws
- The serializer to use to serialize this collection.public String asString()
public String toString()
toString
in class AbstractCollection<T>
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.