Module bus.setting

Class IniSetting

All Implemented Interfaces:
Serializable, Cloneable, Iterable<IniElement>, Collection<IniElement>, List<IniElement>, RandomAccess, SequencedCollection<IniElement>

public class IniSetting extends ArrayList<IniElement>
Ini数据,扩展ArrayList <IniElement> 如果要向此ini添加空行,只需添加null 如果您想创建Ini,则可以Builder
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Constructor Details

    • IniSetting

      public IniSetting()
    • IniSetting

      public IniSetting(int initialCapacity)
    • IniSetting

      public IniSetting(Collection<? extends IniElement> c)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class AbstractCollection<IniElement>
    • toProperties

      public Props toProperties(String delimiter)

      get properties.

      for example:

      [se1] # section named 'se1' # key 1 key1=value1 # key 2 key1=value2 [se2]

      will be

      se1${delimiter}value1=value1 se1${delimiter}value2=value2

      Suppose delimiter is'.'

      se1.value1=value1 se1.value2=value2

      Parameters:
      delimiter - Connect the property value to the section value. if null, ignore section.
      Returns:
      properties
    • toProperties

      public Props toProperties()
      to properties. delimiter is '.'
      Returns:
      properties
      See Also:
    • write

      public void write(OutputStream out, Charset charset, boolean withComment) throws IOException
      write the toString() value to output stream.
      Parameters:
      out - output stream.
      charset - param for String.getBytes(Charset)
      withComment - write with comment
      Throws:
      IOException - io exception from OutputStream.write(byte[])
    • write

      public void write(OutputStream out, boolean withComment) throws IOException
      write the toString() value to output stream. charset is utf-8
      Parameters:
      out - output stream.
      withComment - write with comment
      Throws:
      IOException - io exception from OutputStream.write(byte[])
      See Also:
    • write

      public void write(Writer writer, boolean withComment) throws IOException
      write the toString() value to Writer.
      Parameters:
      writer - Writer
      withComment - write with comment
      Throws:
      IOException - io exception from Writer.write(String)
    • write

      public void write(PrintStream print, boolean withComment)
      write the toString() value to PrintStream.
      Parameters:
      print - PrintStream
      withComment - write with comment
    • write

      public void write(File file, Charset charset, boolean withComment) throws IOException
      write the toString() value to File.
      Parameters:
      file - file
      charset - charset
      withComment - write with comment
      Throws:
      IOException - io exception
    • write

      public void write(File file, boolean withComment) throws IOException
      write the toString() value to File. charset is utf-8
      Parameters:
      file - file
      withComment - write with comment
      Throws:
      IOException - io exception
    • write

      public void write(Path path, Charset charset, boolean withComment) throws IOException
      write the toString() value to Path(file).
      Parameters:
      path - path
      charset - charset
      withComment - write with comment
      Throws:
      IOException - io exception
    • write

      public void write(Path path, boolean withComment) throws IOException
      write the toString() value to Path(file). charset is utf-8
      Parameters:
      path - path
      withComment - write with comment
      Throws:
      IOException - io exception