Class AbstractSelectorComponent.BaseSelectorComponentContext<T,I extends Nameable & Matchable & Itemable<T>,C extends AbstractSelectorComponent.SelectorComponentContext<T,I,C>>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<Object,Object>
org.springframework.shell.component.context.BaseComponentContext<C>
org.springframework.shell.component.support.AbstractSelectorComponent.BaseSelectorComponentContext<T,I,C>
- All Implemented Interfaces:
Serializable,Cloneable,Map<Object,,Object> ComponentContext<C>,AbstractSelectorComponent.SelectorComponentContext<T,I, C>
- Enclosing class:
- AbstractSelectorComponent<T,
C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>, I extends Nameable & Matchable & Enableable & Selectable & Itemable<T>>
protected static class AbstractSelectorComponent.BaseSelectorComponentContext<T,I extends Nameable & Matchable & Itemable<T>,C extends AbstractSelectorComponent.SelectorComponentContext<T,I,C>>
extends BaseComponentContext<C>
implements AbstractSelectorComponent.SelectorComponentContext<T,I,C>
Base implementation of a
AbstractSelectorComponent.SelectorComponentContext.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a cursor row.getInput()Gets an input.getItems()Gets an items.Gets an item statesGets an item state view.getName()Gets a name.Gets a result items.booleanisResult()Return if there is a result.voidsetCursorRow(Integer cursorRow) Sets a cursor row.voidSets an input.voidSets an items.voidsetItemStates(List<AbstractSelectorComponent.ItemState<I>> itemStates) Sets an item states.voidsetItemStateView(List<AbstractSelectorComponent.ItemState<I>> itemStateView) Sets an item state viewvoidSets a namevoidsetResultItems(List<I> resultItems) Sets a result items.toString()Gets context values as a map.Methods inherited from class org.springframework.shell.component.context.BaseComponentContext
get, get, getTerminalWidth, put, setTerminalWidth, streamMethods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesMethods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class java.util.AbstractMap
equals, hashCodeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.shell.component.context.ComponentContext
containsKey, get, get, getTerminalWidth, put, setTerminalWidth, streamMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, size
-
Constructor Details
-
BaseSelectorComponentContext
protected BaseSelectorComponentContext()
-
-
Method Details
-
getName
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextGets a name. -
setName
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextSets a name -
getInput
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextGets an input. -
setInput
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextSets an input. -
getItemStates
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextGets an item states- Specified by:
getItemStatesin interfaceAbstractSelectorComponent.SelectorComponentContext<T,I extends Nameable & Matchable & Itemable<T>, C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>> - Returns:
- an item states
-
setItemStates
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextSets an item states.- Specified by:
setItemStatesin interfaceAbstractSelectorComponent.SelectorComponentContext<T,I extends Nameable & Matchable & Itemable<T>, C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>> - Parameters:
itemStates- the input state
-
getItemStateView
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextGets an item state view.- Specified by:
getItemStateViewin interfaceAbstractSelectorComponent.SelectorComponentContext<T,I extends Nameable & Matchable & Itemable<T>, C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>> - Returns:
- an item state view
-
setItemStateView
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextSets an item state view- Specified by:
setItemStateViewin interfaceAbstractSelectorComponent.SelectorComponentContext<T,I extends Nameable & Matchable & Itemable<T>, C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>> - Parameters:
itemStateView- the item state view
-
isResult
public boolean isResult()Description copied from interface:AbstractSelectorComponent.SelectorComponentContextReturn if there is a result. -
getCursorRow
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextGets a cursor row.- Specified by:
getCursorRowin interfaceAbstractSelectorComponent.SelectorComponentContext<T,I extends Nameable & Matchable & Itemable<T>, C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>> - Returns:
- a cursor row.
-
toTemplateModel
Description copied from interface:ComponentContextGets context values as a map. Every context implementation can do their own model as essentially what matter is a one coming out from a last child which is one most likely to feed into a template engine.- Specified by:
toTemplateModelin interfaceComponentContext<T>- Overrides:
toTemplateModelin classBaseComponentContext<C extends AbstractSelectorComponent.SelectorComponentContext<T,I, C>> - Returns:
- map of context values
-
setCursorRow
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextSets a cursor row.- Specified by:
setCursorRowin interfaceAbstractSelectorComponent.SelectorComponentContext<T,I extends Nameable & Matchable & Itemable<T>, C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>> - Parameters:
cursorRow- the cursor row
-
getItems
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextGets an items. -
setItems
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextSets an items. -
getResultItems
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextGets a result items.- Specified by:
getResultItemsin interfaceAbstractSelectorComponent.SelectorComponentContext<T,I extends Nameable & Matchable & Itemable<T>, C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>> - Returns:
- a result items
-
setResultItems
Description copied from interface:AbstractSelectorComponent.SelectorComponentContextSets a result items.- Specified by:
setResultItemsin interfaceAbstractSelectorComponent.SelectorComponentContext<T,I extends Nameable & Matchable & Itemable<T>, C extends AbstractSelectorComponent.SelectorComponentContext<T, I, C>> - Parameters:
resultItems- the result items
-
toString
- Overrides:
toStringin classBaseComponentContext<C extends AbstractSelectorComponent.SelectorComponentContext<T,I, C>>
-