Class MemoryStyleSource

java.lang.Object
org.jline.style.MemoryStyleSource
All Implemented Interfaces:
StyleSource

public class MemoryStyleSource extends Object implements StyleSource
In-memory StyleSource.
Since:
3.4
  • Constructor Details

    • MemoryStyleSource

      public MemoryStyleSource()
  • Method Details

    • get

      @Nullable public String get(String group, String name)
      Description copied from interface: StyleSource
      Returns the appropriate style for the given style-group and style-name, or null if missing.
      Specified by:
      get in interface StyleSource
      Parameters:
      group - the group
      name - the style name
      Returns:
      the style
    • set

      public void set(String group, String name, String style)
      Description copied from interface: StyleSource
      Set a specific style in a style-group.
      Specified by:
      set in interface StyleSource
      Parameters:
      group - the group
      name - the style name
      style - the style to set
    • remove

      public void remove(String group)
      Description copied from interface: StyleSource
      Remove all styles for given style-group.
      Specified by:
      remove in interface StyleSource
      Parameters:
      group - the group
    • remove

      public void remove(String group, String name)
      Description copied from interface: StyleSource
      Remove a specific style from style-group.
      Specified by:
      remove in interface StyleSource
      Parameters:
      group - the group
      name - the style name to remove
    • clear

      public void clear()
      Description copied from interface: StyleSource
      Clear all styles.
      Specified by:
      clear in interface StyleSource
    • groups

      public Iterable<String> groups()
      Description copied from interface: StyleSource
      Returns configured style-group names.
      Specified by:
      groups in interface StyleSource
      Returns:
      Immutable collection.
    • styles

      public Map<String,String> styles(String group)
      Description copied from interface: StyleSource
      Returns configured styles for given style-group.
      Specified by:
      styles in interface StyleSource
      Parameters:
      group - the style group
      Returns:
      Immutable map.