Package org.jline.style
Class MemoryStyleSource
- java.lang.Object
-
- org.jline.style.MemoryStyleSource
-
- All Implemented Interfaces:
StyleSource
public class MemoryStyleSource extends java.lang.Object implements StyleSource
In-memoryStyleSource
.- Since:
- 3.4
-
-
Constructor Summary
Constructors Constructor Description MemoryStyleSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear all styles.java.lang.String
get(java.lang.String group, java.lang.String name)
Returns the appropriate style for the given style-group and style-name, ornull
if missing.java.lang.Iterable<java.lang.String>
groups()
Returns configured style-group names.void
remove(java.lang.String group)
Remove all styles for given style-group.void
remove(java.lang.String group, java.lang.String name)
Remove a specific style from style-group.void
set(java.lang.String group, java.lang.String name, java.lang.String style)
Set a specific style in a style-group.java.util.Map<java.lang.String,java.lang.String>
styles(java.lang.String group)
Returns configured styles for given style-group.
-
-
-
Method Detail
-
get
@Nullable public java.lang.String get(java.lang.String group, java.lang.String name)
Description copied from interface:StyleSource
Returns the appropriate style for the given style-group and style-name, ornull
if missing.- Specified by:
get
in interfaceStyleSource
- Parameters:
group
- the groupname
- the style name- Returns:
- the style
-
set
public void set(java.lang.String group, java.lang.String name, java.lang.String style)
Description copied from interface:StyleSource
Set a specific style in a style-group.- Specified by:
set
in interfaceStyleSource
- Parameters:
group
- the groupname
- the style namestyle
- the style to set
-
remove
public void remove(java.lang.String group)
Description copied from interface:StyleSource
Remove all styles for given style-group.- Specified by:
remove
in interfaceStyleSource
- Parameters:
group
- the group
-
remove
public void remove(java.lang.String group, java.lang.String name)
Description copied from interface:StyleSource
Remove a specific style from style-group.- Specified by:
remove
in interfaceStyleSource
- Parameters:
group
- the groupname
- the style name to remove
-
clear
public void clear()
Description copied from interface:StyleSource
Clear all styles.- Specified by:
clear
in interfaceStyleSource
-
groups
public java.lang.Iterable<java.lang.String> groups()
Description copied from interface:StyleSource
Returns configured style-group names.- Specified by:
groups
in interfaceStyleSource
- Returns:
- Immutable collection.
-
styles
public java.util.Map<java.lang.String,java.lang.String> styles(java.lang.String group)
Description copied from interface:StyleSource
Returns configured styles for given style-group.- Specified by:
styles
in interfaceStyleSource
- Parameters:
group
- the style group- Returns:
- Immutable map.
-
-