Beispiel #1
0
  @Override
  public String toString() {
    final StringBuilder builder = new StringBuilder();
    List<Capability> identities = getCapabilities(IdentityNamespace.IDENTITY_NAMESPACE);
    if (identities != null && identities.size() == 1) {
      Capability idCap = identities.get(0);
      Object id = idCap.getAttributes().get(IdentityNamespace.IDENTITY_NAMESPACE);
      Object version = idCap.getAttributes().get(IdentityNamespace.CAPABILITY_VERSION_ATTRIBUTE);

      builder.append(id).append(" ver=").append(version);
    } else {
      // Generic toString
      builder.append("ResourceImpl [caps=");
      builder.append(allCapabilities);
      builder.append(", reqs=");
      builder.append(allRequirements);
      builder.append("]");
    }
    return builder.toString();
  }