Package org.silverpeas.core.util
Class SilverpeasBundleList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<String>
-
- org.silverpeas.core.util.SilverpeasBundleList
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<String>
,Collection<String>
,List<String>
,RandomAccess
public class SilverpeasBundleList extends ArrayList<String>
This class permits to handle the result of property value list search.- Author:
- Yohann Chastagnier
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer[]
asIntegerArray()
Converts the list into an array ofInteger
.Integer[]
asIntegerArray(Integer defaultValue)
Converts the list into an array ofInteger
.List<Integer>
asIntegerList()
Converts the list into a list ofInteger
.List<Integer>
asIntegerList(Integer defaultValue)
Converts the list into a list ofInteger
.String[]
asStringArray()
Converts the list into an array ofString
.String[]
asStringArray(String defaultValue)
Converts the list into an array ofString
.List<String>
asStringList(String defaultValue)
Converts the list into an list ofString
with default value if necessary.static SilverpeasBundleList
with(String... values)
Initializes a list with the given string values if any.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Method Detail
-
with
public static SilverpeasBundleList with(String... values)
Initializes a list with the given string values if any.- Parameters:
values
- none, one or several string values.- Returns:
- the initialized list.
-
asStringArray
public String[] asStringArray()
Converts the list into an array ofString
.- Returns:
- the current list converted into
String
array. No treatment is performed about not defined values.
-
asStringArray
public String[] asStringArray(String defaultValue)
Converts the list into an array ofString
.- Parameters:
defaultValue
- the default value to register if one is not defined.- Returns:
- the current list converted into
String
array with default value applied on not defined values.
-
asStringList
public List<String> asStringList(String defaultValue)
Converts the list into an list ofString
with default value if necessary.- Parameters:
defaultValue
- the default value to register if one is not defined.- Returns:
- the current list converted into
String
list with default value applied on not defined values.
-
asIntegerArray
public Integer[] asIntegerArray()
Converts the list into an array ofInteger
.- Returns:
- the current list converted into
Integer
array with null value applied on not defined values. - Throws:
NumberFormatException
- if the string does not contain a parsable integer.
-
asIntegerList
public List<Integer> asIntegerList()
Converts the list into a list ofInteger
.- Returns:
- the current list converted into
Integer
list with null value applied on not defined values. - Throws:
NumberFormatException
- if the string does not contain a parsable integer.
-
asIntegerArray
public Integer[] asIntegerArray(Integer defaultValue)
Converts the list into an array ofInteger
.- Parameters:
defaultValue
- the default value to register if one is not defined.- Returns:
- the current list converted into
Integer
array with default value applied on not defined values. - Throws:
NumberFormatException
- if the string does not contain a parsable integer.
-
asIntegerList
public List<Integer> asIntegerList(Integer defaultValue)
Converts the list into a list ofInteger
.- Parameters:
defaultValue
- the default value to register if one is not defined.- Returns:
- the current list converted into
Integer
list with default value applied on not defined values. - Throws:
NumberFormatException
- if the string does not contain a parsable integer.
-
-