Example #1
0
  protected AbstractTypedFilter(
      final Collection<RelationshipType> types,
      final Collection<RelationshipType> descendantTypes,
      final boolean includeManagedInfo,
      final boolean includeConcreteInfo) {
    if (types == null || types.isEmpty()) {
      this.types =
          Collections.unmodifiableSet(
              new HashSet<RelationshipType>(Arrays.asList(RelationshipType.values())));
    } else {
      this.types = Collections.unmodifiableSet(new HashSet<RelationshipType>(types));
    }

    if (descendantTypes == null || descendantTypes.isEmpty()) {
      this.descendantTypes =
          Collections.unmodifiableSet(
              new HashSet<RelationshipType>(Arrays.asList(RelationshipType.values())));
    } else {
      this.descendantTypes =
          Collections.unmodifiableSet(new HashSet<RelationshipType>(descendantTypes));
    }

    this.includeManagedInfo = includeManagedInfo;
    this.includeConcreteInfo = includeConcreteInfo;
  }
Example #2
0
  protected AbstractTypedFilter(
      final RelationshipType type,
      final boolean hasDescendants,
      final boolean includeManagedInfo,
      final boolean includeConcreteInfo) {
    if (type == null) {
      this.types =
          Collections.unmodifiableSet(
              new HashSet<RelationshipType>(Arrays.asList(RelationshipType.values())));
    } else {
      this.types = Collections.unmodifiableSet(Collections.singleton(type));
    }

    if (hasDescendants) {
      this.descendantTypes = types;
    } else {
      this.descendantTypes = Collections.unmodifiableSet(Collections.<RelationshipType>emptySet());
    }

    this.includeManagedInfo = includeManagedInfo;
    this.includeConcreteInfo = includeConcreteInfo;
  }