public class StringSet extends AnchorBean<StringSet> implements PrimitiveBeanCollection<String>
String
s.
The elements are stored internally in a consistent ordering, according to their natural comparator.
An example:
<datasets config-class="org.anchoranalysis.bean.primitive.StringSet" config-factory="stringSet">
<item>first_dataset</item>
<item>second_dataset</item>
<item>some_other_dataset</item>
</datasets>
Constructor and Description |
---|
StringSet() |
StringSet(Set<String> set) |
StringSet(String... values)
Constructs with one or more values added to the list.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String value)
Add an element to the collection.
|
protected boolean |
canEqual(Object other) |
boolean |
contains(String value)
Whether the collection contains a particular element?
|
StringSet |
duplicateBean()
Duplicate the bean.
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isEmpty()
Whether the collection is empty or not.
|
Iterator<String> |
iterator() |
Set<String> |
set()
The underlying set of values.
|
java.util.stream.Stream<String> |
stream()
Creates a stream of elements in the set.
|
checkMisconfigured, describeBean, describeChildren, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
forEach, spliterator
public StringSet(String... values)
values
- the valuespublic StringSet()
public void add(String value)
PrimitiveBeanCollection
add
in interface PrimitiveBeanCollection<String>
value
- the element to add.public boolean contains(String value)
PrimitiveBeanCollection
contains
in interface PrimitiveBeanCollection<String>
value
- the element to search forpublic boolean isEmpty()
PrimitiveBeanCollection
isEmpty
in interface PrimitiveBeanCollection<String>
public java.util.stream.Stream<String> stream()
public StringSet duplicateBean()
NOTE: We need to specifically-implement it as the AnchorBean
functionality won't
work with this implementation, as it uses non-default initialization (using a config-factory)
duplicateBean
in class AnchorBean<StringSet>
protected boolean canEqual(Object other)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.