Class Session

  • All Implemented Interfaces:
    Serializable, top.focess.util.SectionMap
    Direct Known Subclasses:
    SessionSection

    public class Session
    extends Object
    implements top.focess.util.SectionMap
    This class is used to build better communication between Command and CommandSender. It can save something in the executing process and can be used for future.
    See Also:
    Serialized Form
    • Constructor Detail

      • Session

        public Session​(@Nullable
                       Map<String,​Object> values)
        Initializes the Session with existed key-value pairs (usually not)
        Parameters:
        values - the session key-value pairs
    • Method Detail

      • createSection

        public SessionSection createSection​(String key)
        Specified by:
        createSection in interface top.focess.util.SectionMap
      • getValues

        public Map<String,​Object> getValues()
        Specified by:
        getValues in interface top.focess.util.SectionMap
      • getSection

        public top.focess.util.SectionMap getSection​(String key)
        Specified by:
        getSection in interface top.focess.util.SectionMap
      • containsSection

        public boolean containsSection​(String key)
        Specified by:
        containsSection in interface top.focess.util.SectionMap
      • set

        public void set​(String key,
                        Object value)
        Specified by:
        set in interface top.focess.util.SectionMap
      • get

        public <T> T get​(String key)
        Specified by:
        get in interface top.focess.util.SectionMap
      • getOrDefault

        public <T> T getOrDefault​(String key,
                                  T defaultValue)
        Specified by:
        getOrDefault in interface top.focess.util.SectionMap
      • contains

        public boolean contains​(String key)
        Specified by:
        contains in interface top.focess.util.SectionMap
      • remove

        public void remove​(String key)
        Specified by:
        remove in interface top.focess.util.SectionMap
      • compute

        public void compute​(String key,
                            java.util.function.BiFunction<? super String,​? super Object,​?> remappingFunction)
        Specified by:
        compute in interface top.focess.util.SectionMap