コード例 #1
0
  @Override
  public BDRSWurflCapability create(Session sesh, String group, String name, String value) {
    if (sesh == null) {
      sesh = getSession();
    }

    BDRSWurflCapability capability = new BDRSWurflCapability();
    capability.setGroup(group);
    capability.setName(name);
    capability.setValue(value);

    return save(sesh, capability);
  }
コード例 #2
0
  @Override
  public HashMap<String, HashMap<String, BDRSWurflCapability>> getCapabilitiesMap() {
    HashMap<String, HashMap<String, BDRSWurflCapability>> capabilitiesMap =
        new HashMap<String, HashMap<String, BDRSWurflCapability>>();
    List<BDRSWurflCapability> capabilities = this.getAll();

    for (BDRSWurflCapability c : capabilities) {
      if (capabilitiesMap.get(c.getName()) != null) {
        capabilitiesMap.get(c.getName()).put(c.getValue(), c);
      } else {
        HashMap<String, BDRSWurflCapability> valueToCapabability =
            new HashMap<String, BDRSWurflCapability>();
        valueToCapabability.put(c.getValue(), c);
        capabilitiesMap.put(c.getName(), valueToCapabability);
      }
    }

    return capabilitiesMap;
  }