Class IndexedPackage<C>
java.lang.Object
ch.nolix.base.net.messaging.IndexedPackage<C>
- Type Parameters:
C- is the type of the content of aIndexedPackage.
A
IndexedPackage bundles an index and a content.- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionfinal intgetIndex()final Cfinal booleanhasIndex(int index) static <C2> IndexedPackage<C2> withIndexAndContent(int index, C2 content)
-
Method Details
-
withIndexAndContent
- Type Parameters:
C2- is the type of the given content.- Parameters:
index-content-- Returns:
- a new
IndexedPackagewith the given index and content. - Throws:
RuntimeException- if the given content is null.
-
getStoredContent
- Returns:
- the content of the current
IndexedPackage.
-
getIndex
public final int getIndex()- Returns:
- the index of the current
IndexedPackage.
-
hasIndex
public final boolean hasIndex(int index) - Parameters:
index-- Returns:
- true if the current
IndexedPackagehas the given index, false otherwise.
-