Class MetadataModel.Section

java.lang.Object
net.sf.basedb.util.bfs.MetadataModel.Section
Enclosing class:
MetadataModel

public static class MetadataModel.Section
extends Object
Holds information about a section.
  • Field Details

  • Constructor Details

    • Section

      public Section​(String name)
      Create a new section.
      Parameters:
      name - The name of the section
  • Method Details

    • getName

      public String getName()
      Get the name of the section.
    • getEntryCount

      public int getEntryCount()
      Get the number of entries in this section.
    • addEntry

      public void addEntry​(MetadataModel.SectionEntry entry)
      Add a new entry to this section.
    • addEntry

      public MetadataModel.SectionEntry addEntry​(String key, String... values)
      Add a new entry to this section.
      Parameters:
      key - The key of the entry
      values - The values
    • getEntry

      public MetadataModel.SectionEntry getEntry​(int index)
      Get the entry in this section with the given index.
      Parameters:
      index - The index of the entry, a value between 0 and getEntryCount() - 1
      Returns:
      A section entry
    • getEntry

      public MetadataModel.SectionEntry getEntry​(String key)
      Get the first entry in this section with a given key.
      Parameters:
      key - The key to look for
      Returns:
      A section entry, or null if no entry with the given key exists
    • getKey

      public String getKey​(int index)
      Get the key of the entry at the given index.
      Parameters:
      index - The index of the entry, a value between 0 and getEntryCount() - 1
      Returns:
      The key of the entry
    • getIndex

      public int getIndex​(String key)
      Get the index of the first entry with the given key.
      Parameters:
      key - The key to look for
      Returns:
      The index of the entry, or -1 if the key is not found
    • getValue

      public String getValue​(int index)
      Get the value of the entry at the given index.
      Parameters:
      index - The index of the entry, a value between 0 and getEntryCount() - 1
      Returns:
      The value of the entry
    • getValues

      public String[] getValues​(int index)
      Get the values of the entry at the given index.
      Parameters:
      index - The index of the entry, a value between 0 and getEntryCount() - 1
      Returns:
      The value of the entry
    • getValue

      public String getValue​(String key)
      Get the value of the first entry with a given key.
      Parameters:
      key - The key of the entry
      Returns:
      The value, or null if no entry for the given key exists
    • getValues

      public String[] getValues​(String key)
      Get the values of the first entry with a given key.
      Parameters:
      key - The key of the entry
      Returns:
      The value, or null if no entry for the given key exists