Class LanguageSettingsStorage

    • Constructor Detail

      • LanguageSettingsStorage

        public LanguageSettingsStorage()
    • Method Detail

      • getSettingEntries

        public List<ICLanguageSettingEntry> getSettingEntries​(String rcProjectPath,
                                                              String languageId)
        Returns the list of setting entries for the given resource and language.
        Note that this list is unmodifiable.
        Parameters:
        rcProjectPath - - path to the resource relative to the project.
        languageId - - language id.
        Returns:
        the list of setting entries or null if no settings defined.
      • setSettingEntries

        public void setSettingEntries​(String rcProjectPath,
                                      String languageId,
                                      List<? extends ICLanguageSettingEntry> entries)
        Sets language settings entries for the resource and language.
        Parameters:
        rcProjectPath - - path to the resource relative to the project. If null the entries are considered to be being defined as default entries for resources.
        languageId - - language id. If null, then entries are considered to be defined for the language scope.
        entries - - language settings entries to set.
      • isEmpty

        public boolean isEmpty()
        Returns:
        true if the storage is empty or false otherwise.
      • clear

        public void clear()
        Clear all the entries for all resources and all languages.
      • getLanguages

        public Set<String> getLanguages()
        Returns:
        set of all languages associated with the entries. Note that the storage can keep default entries for the language scope of the provider, so the set can contain null.
      • getResourcePaths

        public Set<String> getResourcePaths​(String languageId)
        Returns set of paths for all resources associated with entries for given language. The paths are project relative.
        Parameters:
        languageId - - language ID.
        Returns:
        the set of resource paths associated with entries for the given language or empty set. Note that the storage can keep default entries for resources, so the set can contain null.
      • getPooledList

        public static List<ICLanguageSettingEntry> getPooledList​(List<ICLanguageSettingEntry> entries)
        Find and return the equal list of entries from the pool to conserve the memory.
        Parameters:
        entries - - list of entries to pool.
        Returns:
        returns the list of entries from the pool.
      • getPooledEmptyList

        public static List<ICLanguageSettingEntry> getPooledEmptyList()
        Returns:
        Returns the empty immutable list which is pooled. Use this call rather than creating new empty array to ensure that faster shallow operator '==' can be used instead of equals() which goes deep on HashMaps.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object