Interface ListNode
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new object to thisListNode.voidaddAll(@NotNull Collection<?> collection) Adds new objects in the givenCollectionto thisListNode.@NotNull ListNodeaddList()@NotNull ListNodeaddList(int initialCapacity) @NotNull MapNodeaddMap()<T> @NotNull @Unmodifiable List<T>@NotNull @UnmodifiableView ListNodeasView()Gets a view of thisListNode.voidclear()Clears thisListNode.@NotNull ListNodecopy()Copies thisListNode.static @NotNull ListNodecreate()Creates a newListNode.static @NotNull ListNodecreate(int initialCapacity) Creates a newListNode.static @NotNull ListNodecreate(@NotNull Collection<?> collection) Creates a newListNodewith values in the givenCollection.static @NotNull @Unmodifiable ListNodeempty()Gets aListNodethat is always empty.voidRemoves an object from thisListNode.voidRemoves the elements from thisListNodethat satisfy the given predicate.stream()Creates aStreamfrom an internal list.value()Methods inherited from interface com.github.siroshun09.configapi.core.node.CommentableNode
getComment, getCommentOrNull, hasComment, setCommentMethods inherited from interface com.github.siroshun09.configapi.core.node.Node
accept, asOptional, hasValue
-
Field Details
-
IMPLEMENTATION_CLASS
An implementationClassof 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 newListNodewith values in the givenCollection.- Parameters:
collection- aCollectionto add elements to the newListNode- Returns:
- a new
ListNodewith values in the givenCollection
-
empty
Gets aListNodethat is always empty.The returning
ListNodecannot be modified using methods likeadd(Object).- Returns:
- a
ListNodethat is always empty
-
value
-
asList
@NotNull <T> @NotNull @Unmodifiable List<T> asList(@NotNull @NotNull Class<? extends T> elementClass) Gets aListcontaining elements of the specifiedClass.The returning
Listis immutable.The list only contain elements such that
Class.isInstance(java.lang.Object)returnstrue. Other elements are ignored. -
stream
Creates aStreamfrom an internal list.- Returns:
- a
Streamfrom an internal list
-
add
Adds a new object to thisListNode.- Parameters:
value- a new object
-
addAll
Adds new objects in the givenCollectionto thisListNode.- Parameters:
collection- aCollectionthat 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 thisListNodethat satisfy the given predicate.- Parameters:
predicate- a predicate which returnstruefor elements to be removed
-
clear
void clear()Clears thisListNode. -
copy
Copies thisListNode.The elements in this
ListNodewill also be copied usingNode.fromObject(Object).- Returns:
- a copied
ListNode
-
asView
Gets a view of thisListNode.The returning
ListNodecannot be modified, but thisListNodecan still be modified, so the elements may be changed by other codes using this instance.- Returns:
- a view of this
ListNode
-