Пример #1
0
 // FIXME: Because of compatibility with previous version
 public static tmedia_bandwidth_level_t getBandwidthLevel(String level) {
   if (StringUtils.equals(level, "Medium", true)) {
     return tmedia_bandwidth_level_t.tmedia_bl_medium;
   }
   if (StringUtils.equals(level, "High", true)) {
     return tmedia_bandwidth_level_t.tmedia_bl_hight;
   } else {
     return tmedia_bandwidth_level_t.tmedia_bl_low;
   }
 }
Пример #2
0
 public String getValue(String sectionName, String entryKey) {
   if (!StringUtils.isNullOrEmpty(sectionName) && !StringUtils.isNullOrEmpty(entryKey)) {
     for (ConfigurationSection section : this.sections) {
       if (StringUtils.equals(section.getName(), sectionName, false)) {
         ConfigurationSectionEntry entry = section.getEntry(entryKey);
         return (entry == null) ? null : entry.getValue();
       }
     }
   }
   return null;
 }
Пример #3
0
 public boolean setEntry(String sectionName, String entryKey, String entryValue) {
   if (StringUtils.isNullOrEmpty(sectionName) || StringUtils.isNullOrEmpty(entryKey)) {
     return false;
   }
   ConfigurationSection section = new ConfigurationSection(sectionName);
   int index = this.sections.indexOf(section);
   if (index == -1) {
     section.addEntry(new ConfigurationSectionEntry(entryKey, entryValue));
     return this.sections.add(section);
   } else {
     section = this.sections.get(index);
     section.addEntry(new ConfigurationSectionEntry(entryKey, entryValue));
     // this.sections.set(index, section);
     return true;
   }
 }