Examples of CapabilityReferenceFilter


Examples of org.sonatype.nexus.capability.support.CapabilityReferenceFilterBuilder.CapabilityReferenceFilter

                                                final Boolean enabled,
                                                final Boolean active,
                                                final Boolean includeNotExposed,
                                                final List<String> properties)
  {
    CapabilityReferenceFilter filter = CapabilityReferenceFilterBuilder.capabilities();
    if (type != null) {
      filter = filter.withType(capabilityType(type));
    }
    if (enabled != null) {
      filter = filter.enabled(enabled);
    }
    if (active != null) {
      filter = filter.active(active);
    }
    if (includeNotExposed != null && includeNotExposed) {
      filter = filter.includeNotExposed();
    }
    if (properties != null) {
      for (String property : properties) {
        String propertyName = property;
        String propertyValue = "*";
        if (property.contains(":")) {
          propertyName = property.substring(0, propertyName.indexOf(':'));
          if (propertyName.length() < property.length() - 1) {
            propertyValue = property.substring(propertyName.length() + 1);
          }
        }
        if ("*".equals(propertyValue)) {
          filter = filter.withBoundedProperty(propertyName);
        }
        else {
          filter = filter.withProperty(propertyName, propertyValue);
        }
      }
    }
    return filter;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.