Class TableHelper

java.lang.Object
org.snmp4j.model.snmp.api.TableHelper

public class TableHelper extends Object
The TableHelper class provides helper methods to format table titles and data.
Author:
Frank Fock
  • Field Details

  • Constructor Details

    • TableHelper

      public TableHelper()
  • Method Details

    • getTitlesFromNames

      public static List<String> getTitlesFromNames(String prefix, List<String> names)
      Return column titles for a list of object names and a common prefix of the names which should not be included in the titles.
      Parameters:
      prefix - the prefix to remove from the object names to form the returned column title.
      names - a list of object names that should be used for the titles.
      Returns:
      a list of the same size than names but each title without the specified prefix if present.
    • trimTitleSuffix

      protected static String trimTitleSuffix(String title)
      Removes the last name suffix from the given title.
      Parameters:
      title - a camel case title.
      Returns:
      title with the last camel case word removed.
    • buildColumns

      public static List<SnmpProxyColumn<String>> buildColumns(com.snmp4j.smi.SmiObjectType entryObjet)
      Create the column proxy elements based on a table entry object type.
      Parameters:
      entryObjet - the table Entry object (the object below the table node in the SMI MIB tree).
      Returns:
      the list of proxy column objects for the given table.
    • buildColumns

      public static <T> List<SnmpProxyColumn<T>> buildColumns(com.snmp4j.smi.SmiObjectType child, Class<T> valueClass, SnmpProxyColumnFactory<T> columnFactory)
    • getSnmpProxyColumns

      public static <T> List<SnmpProxyColumn<T>> getSnmpProxyColumns(com.snmp4j.smi.SmiObjectType parentObjectType, Class<T> valueClass, SnmpProxyColumnFactory<T> columnFactory, List<com.snmp4j.smi.SmiObjectType> smiObjectTypes)
      Get the proxy columns for the specified SNMP table definition.
      Type Parameters:
      T - The value type of the proxies.
      Parameters:
      parentObjectType - the parent (i.e., table entry) object type.
      valueClass - the value class of T.
      columnFactory - The factory to be used to create the column proxies.
      smiObjectTypes - The columnar object types. If a columnar object type equals parentObjectType, the column title will be the parent's full object name. Otherwise, the common prefix of the column names and the parent name will be removed from the column titles.
      Returns:
      a list of column snmp proxies corresponding to the number and position of the provided smiObjectTypes.
    • buildIndexColumns

      public static List<SnmpProxyIndexColumn<String>> buildIndexColumns(com.snmp4j.smi.SmiObjectType child)
    • buildIndexColumns

      public static <T> List<SnmpProxyIndexColumn<T>> buildIndexColumns(com.snmp4j.smi.SmiObjectType child, Class<T> valueClass, SnmpProxyColumnFactory<T> columnFactory)