当前位置: 首页>>代码示例>>Java>>正文


Java Profile类代码示例

本文整理汇总了Java中org.ini4j.Profile的典型用法代码示例。如果您正苦于以下问题:Java Profile类的具体用法?Java Profile怎么用?Java Profile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Profile类属于org.ini4j包,在下文中一共展示了Profile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addDwarf

import org.ini4j.Profile; //导入依赖的package包/类
public static Profile.Section addDwarf(Profile prof, DwarfData dwarf)
{
    Profile.Section s = prof.add(dwarf.name);

    inject(s, dwarf, "");
    if (dwarf.name.equals(Dwarfs.PROP_DOPEY))
    {
        s.put(Dwarf.PROP_WEIGHT, DwarfsData.INI_DOPEY_WEIGHT, 0);
        s.put(Dwarf.PROP_HEIGHT, DwarfsData.INI_DOPEY_HEIGHT, 0);
    }
    else if (dwarf.name.equals(Dwarfs.PROP_GRUMPY))
    {
        s.put(Dwarf.PROP_HEIGHT, DwarfsData.INI_GRUMPY_HEIGHT, 0);
    }
    else if (dwarf.name.equals(Dwarfs.PROP_SLEEPY))
    {
        s.put(Dwarf.PROP_HEIGHT, DwarfsData.INI_SLEEPY_HEIGHT, 0);
    }
    else if (dwarf.name.equals(Dwarfs.PROP_SNEEZY))
    {
        s.put(Dwarf.PROP_HOME_PAGE, DwarfsData.INI_SNEEZY_HOME_PAGE, 0);
    }

    return s;
}
 
开发者ID:JetBrains,项目名称:intellij-deps-ini4j,代码行数:26,代码来源:Helper.java

示例2: load

import org.ini4j.Profile; //导入依赖的package包/类
@Override
protected void load(Profile.Section sec) throws Exception {
    afkChannelId = sec.get("afk_channel_id", int.class);
    channels = EasyMethods.convertArrayToList(sec.getAll("channels", int[].class));
    excludeMode = sec.get("exclude_mode", boolean.class);
    whitelistGroup = PermissionGroup.getPermissionGroupByName(sec.get("whitelist_group"));
    afkTime = sec.get("max_afk_time", int.class) * 1000;
    if (sec.get("condition_away", boolean.class))
        afkConditions.add("away");
    if (sec.get("condition_mic_muted", boolean.class))
        afkConditions.add("mic_muted");
    if (sec.get("condition_mic_disabled", boolean.class))
        afkConditions.add("mic_disabled");
    if (sec.get("condition_speaker_muted", boolean.class))
        afkConditions.add("speaker_muted");
    if (sec.get("condition_speaker_disabled", boolean.class))
        afkConditions.add("speaker_disabled");
    afkConditionsMinimumMet = sec.get("condition_min", int.class);
}
 
开发者ID:Scrumplex,项目名称:Sprummlbot,代码行数:20,代码来源:AFKMover.java

示例3: getDefaultIni

import org.ini4j.Profile; //导入依赖的package包/类
private static Ini getDefaultIni() {
    Ini ini = new Ini();
    Profile.Section defaultSec = ini.add("Admins");
    defaultSec.add("uid", "uid1");
    defaultSec.add("group", 6);

    defaultSec = ini.add("Supporters");
    defaultSec.add("uid", "uid2");
    defaultSec.add("group", 6);
    defaultSec.add("inherit", "Admins");

    defaultSec = ini.add("VIPs");
    defaultSec.add("uid", "uid3");
    defaultSec.add("uid", "uid4");
    defaultSec.add("group", 6);
    defaultSec.add("inherit", "Supporters");
    return ini;
}
 
开发者ID:Scrumplex,项目名称:Sprummlbot,代码行数:19,代码来源:Permissions.java

示例4: compare

import org.ini4j.Profile; //导入依赖的package包/类
public Config compare() throws IOException {
    if (defaultIni == null) {
        throw new NullPointerException("Default Config not defined");
    }
    for (Profile.Section section : defaultIni.values()) {
        if (!ini.containsKey(section.getName())) {
            ini.put(section.getName(), section);
            ini.putComment(section.getName(), defaultIni.getComment(section.getName()));
            changed = true;
        } else {
            for (String key : section.keySet()) {
                Profile.Section realSection = ini.get(section.getName());
                if (!realSection.containsKey(key)) {
                    realSection.put(key, section.get(key));
                    realSection.putComment(key, section.getComment(key));
                    changed = true;
                }
            }
        }
    }
    if (wasChanged())
        ini.store();
    return this;
}
 
开发者ID:Scrumplex,项目名称:Sprummlbot,代码行数:25,代码来源:Config.java

示例5: getPartitions

import org.ini4j.Profile; //导入依赖的package包/类
public List<Partition> getPartitions() {
    ArrayList<Partition> partitions = new ArrayList<>();
    if (mCreationMode) {
        partitions.addAll(mPartitions);
        return partitions;
    }

    Profile.Section list = mIni.get("partitions");
    if (list != null) {
        for (Map.Entry<String, String> entry : new TreeMap<>(list).entrySet()) {
            Partition partition = new Partition(entry.getKey(), entry.getValue());

            try {
                if (partition.getType() != Partition.TYPE_BIND)
                    partition.setSize(RootToolsEx.getFileSize(getDirectory() + "/" + partition.toIniPath()));
            } catch (Exception e) {
            }

            partitions.add(partition);
        }
    }

    return partitions;
}
 
开发者ID:efidroid,项目名称:android_app_efidroidmanager,代码行数:25,代码来源:OperatingSystem.java

示例6: parseRemotes

import org.ini4j.Profile; //导入依赖的package包/类
@NotNull
private static Pair<Collection<Remote>, Collection<Url>> parseRemotes(@NotNull Ini ini, @NotNull ClassLoader classLoader) {
  Collection<Remote> remotes = new ArrayList<Remote>();
  Collection<Url> urls = new ArrayList<Url>();
  for (Map.Entry<String, Profile.Section> stringSectionEntry : ini.entrySet()) {
    String sectionName = stringSectionEntry.getKey();
    Profile.Section section = stringSectionEntry.getValue();

    Remote remote = parseRemoteSection(sectionName, section, classLoader);
    if (remote != null) {
      remotes.add(remote);
    }
    else {
      Url url = parseUrlSection(sectionName, section, classLoader);
      if (url != null) {
        urls.add(url);
      }
    }
  }
  return Pair.create(remotes, urls);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:GitConfig.java

示例7: WifImporter

import org.ini4j.Profile; //导入依赖的package包/类
public WifImporter(BitmessageContext ctx, InputStream in, Pubkey.Feature... features) throws IOException {
    this.ctx = ctx;

    Ini ini = new Ini();
    ini.load(in);

    for (Entry<String, Profile.Section> entry : ini.entrySet()) {
        if (!entry.getKey().startsWith("BM-"))
            continue;

        Profile.Section section = entry.getValue();
        BitmessageAddress address = Factory.createIdentityFromPrivateKey(
            entry.getKey(),
            getSecret(section.get("privsigningkey")),
            getSecret(section.get("privencryptionkey")),
            Long.parseLong(section.get("noncetrialsperbyte")),
            Long.parseLong(section.get("payloadlengthextrabytes")),
            Pubkey.Feature.bitfield(features)
        );
        if (section.containsKey("chan")) {
            address.setChan(Boolean.parseBoolean(section.get("chan")));
        }
        address.setAlias(section.get("label"));
        identities.add(address);
    }
}
 
开发者ID:Dissem,项目名称:Jabit,代码行数:27,代码来源:WifImporter.java

示例8: loadEntity

import org.ini4j.Profile; //导入依赖的package包/类
private SubTask loadEntity(Properties properties, Profile.Section currentChild) {
  SubTask instance = loadInstance(properties, currentChild);
  if (instance == null) throw new NullPointerException("Instance is null");
  //If there are specific properties for a type of a tester in the configuration file (.ini)
  instance.setProjectId(projectId);
  instance.setRequestor(requestor);
  instance.configureSubTask(currentChild);
  instance.setMaxIntegrationTestTime(maxIntegrationTestTime);
  instance.setMaxConcurrentSuccessors(maxConcurrentSuccessors);

  String successorRemover = getSuccessorRemover(currentChild);

  for (String subChild : currentChild.childrenNames()) {
    int numInstances =
        Integer.parseInt(currentChild.getChild(subChild).get("num_instances", "1"));
    if (!successorRemover.equals("false") && successorRemover.equals(subChild)) {
      instance.setSuccessorRemover(loadEntity(properties, currentChild.getChild(subChild)));
    } else {
      for (int i = 0; i < numInstances; i++)
        instance.addSuccessor(loadEntity(properties, currentChild.getChild(subChild)));
    }
  }
  return instance;
}
 
开发者ID:openbaton,项目名称:integration-tests,代码行数:25,代码来源:IntegrationTestManager.java

示例9: configureSubTask

import org.ini4j.Profile; //导入依赖的package包/类
@Override
public void configureSubTask(Profile.Section currentSection) {
  this.setTimeout(Integer.parseInt(currentSection.get("timeout", "5")));

  String action = currentSection.get("action");
  if (action == null || action.isEmpty()) {
    try {
      throw new IntegrationTestException("action for VirtualNetworkFunctionRecordWait not set");
    } catch (IntegrationTestException e) {
      e.printStackTrace();
      log.error(e.getMessage());
      System.exit(42);
    }
  }
  this.setAction(Action.valueOf(action));
}
 
开发者ID:openbaton,项目名称:integration-tests,代码行数:17,代码来源:NetworkServiceDescriptorWait.java

示例10: configureSubTask

import org.ini4j.Profile; //导入依赖的package包/类
@Override
public void configureSubTask(Profile.Section currentSection) {
  this.setTimeout(Integer.parseInt(currentSection.get("timeout", "5")));

  String action = currentSection.get("action");
  if (action == null) {
    try {
      throw new IntegrationTestException("action for NetworkServiceRecordWait not set");
    } catch (IntegrationTestException e) {
      e.printStackTrace();
      log.error(e.getMessage());
      System.exit(42);
    }
  }
  this.setAction(Action.valueOf(action));
}
 
开发者ID:openbaton,项目名称:integration-tests,代码行数:17,代码来源:NetworkServiceRecordWait.java

示例11: configureSubTask

import org.ini4j.Profile; //导入依赖的package包/类
@Override
public void configureSubTask(Profile.Section currentSection) {
  String vnfrType = currentSection.get("vnf-type");
  String virtualLink = currentSection.get("virtual-link");
  String floatingIp = currentSection.get("floating-ip");
  if (vnfrType != null) {
    this.setVnfrType(vnfrType);
  }

  if (virtualLink != null) {
    this.setVirtualLink(virtualLink);
  }

  if (floatingIp != null) {
    this.setFloatingIp(floatingIp);
  }
}
 
开发者ID:openbaton,项目名称:integration-tests,代码行数:18,代码来源:ScaleOut.java

示例12: parseRemotes

import org.ini4j.Profile; //导入依赖的package包/类
@NotNull
private static Pair<Collection<Remote>, Collection<Url>> parseRemotes(@NotNull Ini ini, @Nullable ClassLoader classLoader) {
  Collection<Remote> remotes = new ArrayList<Remote>();
  Collection<Url> urls = new ArrayList<Url>();
  for (Map.Entry<String, Profile.Section> stringSectionEntry : ini.entrySet()) {
    String sectionName = stringSectionEntry.getKey();
    Profile.Section section = stringSectionEntry.getValue();

    if (sectionName.startsWith("remote") || sectionName.startsWith("svn-remote")) {
      Remote remote = parseRemoteSection(sectionName, section, classLoader);
      if (remote != null) {
        remotes.add(remote);
      }
    }
    else if (sectionName.startsWith("url")) {
      Url url = parseUrlSection(sectionName, section, classLoader);
      if (url != null) {
        urls.add(url);
      }
    }
  }
  return Pair.create(remotes, urls);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:GitConfig.java

示例13: validate

import org.ini4j.Profile; //导入依赖的package包/类
@Override public void validate(ConfigSchema schema, Ini config) throws ValidationException {
	Map<String, ConstraintValidator> validators = collectValidators();
	for (Map.Entry<String, Profile.Section> entry : config.entrySet()) {
		String groupName = entry.getKey();
		Profile.Section section = entry.getValue();
		for (String name : section.keySet()) {
			SchemaItem item = schema.get(groupName, name);
			if (item == null) {
				// should not happen
				LOGGER.warn("Found configuration item [" + groupName + "] " + name + " without corresponding schema item");
				continue;
			}
			validateItemValues(validators, item, section.getAll(name));
		}
	}
}
 
开发者ID:Skrethel,项目名称:simple-config-retrofit,代码行数:17,代码来源:DefaultSchemaConstraintValidator.java

示例14: parseConfig

import org.ini4j.Profile; //导入依赖的package包/类
@NotNull
private Map<String, String> parseConfig(@NotNull String content) throws IOException {
  @SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
  final Ini ini = new Ini(new StringReader(content));
  final Map<String, String> result = new HashMap<>();
  for (Map.Entry<String, Profile.Section> sectionEntry : ini.entrySet()) {
    for (Map.Entry<String, String> configEntry : sectionEntry.getValue().entrySet()) {
      String value = configEntry.getValue();
      if (value.startsWith("\"") && value.endsWith("\"")) {
        value = value.substring(1, value.length() - 1);
      }
      result.put(sectionEntry.getKey() + ":" + configEntry.getKey(), value);
    }
  }
  return result;
}
 
开发者ID:bozaro,项目名称:git-as-svn,代码行数:17,代码来源:GitTortoise.java

示例15: getCfgValue

import org.ini4j.Profile; //导入依赖的package包/类
public String getCfgValue(String section, String key) throws NulsException {
    Profile.Section ps = ini.get(section);
    if (null == ps) {
        throw new NulsException(ErrorCode.CONFIGURATION_ITEM_DOES_NOT_EXIST);
    }
    String value = ps.get(key);
    if (StringUtils.isBlank(value)) {
        throw new NulsException(ErrorCode.CONFIGURATION_ITEM_DOES_NOT_EXIST);
    }
    return value;
}
 
开发者ID:nuls-io,项目名称:nuls,代码行数:12,代码来源:IniEntity.java


注:本文中的org.ini4j.Profile类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。