Class EditorConfig

All Implemented Interfaces:
Adaptable

public class EditorConfig extends Adaptable.DefaultAdaptable
A immutable model of an .editorconfig file.
  • Field Details

    • root

      private final Boolean root
      Citing from http://editorconfig.org/ : "A search for .editorconfig files will stop if the root filepath is reached or an EditorConfig file with root=true is found."

      Note that the type of root is Boolean rather than boolean. A null root means that the `root` property was not available in the file.

    • sections

      private final List<Section> sections
    • version

      private final Version version
  • Constructor Details

    • EditorConfig

      EditorConfig(List<Object> adapters, Boolean root, Version version, List<Section> sections)
      You look for builder() if you wonder why this constructor is package visible.
      Parameters:
      adapters -
      root -
      version -
      sections -
  • Method Details

    • builder

      public static EditorConfig.Builder builder()
      Returns:
      a new EditorConfig.Builder
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getSections

      public List<Section> getSections()
      Returns:
      the List of Sections
    • getVersion

      public Version getVersion()
      Returns:
      The version of EditorConfig specification, the current EditorConfig model is compliant with
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • hasRootProperty

      public boolean hasRootProperty()
      Returns:
      true if the underlying .editorconfig file had the root property specified; false otherwise. A shorthand for getRoot() != null
    • isRoot

      public boolean isRoot()
      Returns:
      true if a search for .editorconfig files should stop at the present directory level.
    • toString

      public String toString()
      Overrides:
      toString in class Object