Interface ListNode
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new object to thisListNode
.void
addAll
(@NotNull Collection<?> collection) Adds new objects in the givenCollection
to thisListNode
.@NotNull ListNode
addList()
@NotNull ListNode
addList
(int initialCapacity) @NotNull MapNode
addMap()
<T> @NotNull @Unmodifiable List<T>
@NotNull @UnmodifiableView ListNode
asView()
Gets a view of thisListNode
.void
clear()
Clears thisListNode
.@NotNull ListNode
copy()
Copies thisListNode
.static @NotNull ListNode
create()
Creates a newListNode
.static @NotNull ListNode
create
(int initialCapacity) Creates a newListNode
.static @NotNull ListNode
create
(@NotNull Collection<?> collection) Creates a newListNode
with values in the givenCollection
.static @NotNull @Unmodifiable ListNode
empty()
Gets aListNode
that is always empty.void
Removes an object from thisListNode
.void
Removes the elements from thisListNode
that satisfy the given predicate.stream()
Creates aStream
from an internal list.value()
Methods inherited from interface com.github.siroshun09.configapi.core.node.CommentableNode
getComment, getCommentOrNull, hasComment, setComment
Methods inherited from interface com.github.siroshun09.configapi.core.node.Node
accept, asOptional, hasValue
-
Field Details
-
IMPLEMENTATION_CLASS
An implementationClass
of this interface.
-
-
Method Details
-
create
Creates a newListNode
.- Returns:
- a new
ListNode
-
create
Creates a newListNode
.- Parameters:
initialCapacity
- the initial capacity of the list- Returns:
- a new
ListNode
-
create
Creates a newListNode
with values in the givenCollection
.- Parameters:
collection
- aCollection
to add elements to the newListNode
- Returns:
- a new
ListNode
with values in the givenCollection
-
empty
Gets aListNode
that is always empty.The returning
ListNode
cannot be modified using methods likeadd(Object)
.- Returns:
- a
ListNode
that is always empty
-
value
-
asList
@NotNull <T> @NotNull @Unmodifiable List<T> asList(@NotNull @NotNull Class<? extends T> elementClass) Gets aList
containing elements of the specifiedClass
.The returning
List
is immutable.The list only contain elements such that
Class.isInstance(java.lang.Object)
returnstrue
. Other elements are ignored. -
stream
Creates aStream
from an internal list.- Returns:
- a
Stream
from an internal list
-
add
Adds a new object to thisListNode
.- Parameters:
value
- a new object
-
addAll
Adds new objects in the givenCollection
to thisListNode
.- Parameters:
collection
- aCollection
that includes new objects to add
-
addList
- Returns:
- a created
ListNode
-
addList
- Parameters:
initialCapacity
- the initial capacity of the list- Returns:
- a created
ListNode
-
addMap
- Returns:
- a created
MapNode
-
remove
Removes an object from thisListNode
.- Parameters:
value
- an object to remove from thisListNode
-
removeIf
Removes the elements from thisListNode
that satisfy the given predicate.- Parameters:
predicate
- a predicate which returnstrue
for elements to be removed
-
clear
void clear()Clears thisListNode
. -
copy
Copies thisListNode
.The elements in this
ListNode
will also be copied usingNode.fromObject(Object)
.- Returns:
- a copied
ListNode
-
asView
Gets a view of thisListNode
.The returning
ListNode
cannot be modified, but thisListNode
can still be modified, so the elements may be changed by other codes using this instance.- Returns:
- a view of this
ListNode
-