Class MapAccessor


  • public final class MapAccessor
    extends Object
    Class to wrap a SnakeYML Map with to allow access via a path
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Method to get whether the map is empty
        Returns:
      • getMap

        public Map<String,​Object> getMap()
        Method to get the internal Map
        Returns:
      • put

        public MapAccessor put​(String path,
                               boolean value)
        Method to set a path value
        Parameters:
        path -
        value -
        Returns:
      • put

        public MapAccessor put​(String path,
                               short value)
        Method to set a path value
        Parameters:
        path -
        value -
        Returns:
      • put

        public MapAccessor put​(String path,
                               int value)
        Method to set a path value
        Parameters:
        path -
        value -
        Returns:
      • put

        public MapAccessor put​(String path,
                               float value)
        Method to set a path value
        Parameters:
        path -
        value -
        Returns:
      • put

        public MapAccessor put​(String path,
                               String value)
        Method to set a path value
        Parameters:
        path -
        value -
        Returns:
      • get

        public Optional<Object> get​(String path)
        Method to get a path value
        Parameters:
        path -
        Returns:
      • delete

        public Optional<Object> delete​(String path)
        Method to delete a path value
        Parameters:
        path -
      • containsPath

        public boolean containsPath​(String path)
        Method to determine if a path contains a value, equivalent to get(path).isPresent()
        Parameters:
        path -
        Returns:
      • of

        public static MapAccessor of​(Map<String,​Object> map)
        Method to get an instance of a MapAccessor
        Parameters:
        map -
        Returns: