/** * Get a roles collection which consists of the roles in this collection minus the roles in the other collection. * * @param other the other collection (must not be {@code null}) * @return the difference (not {@code null}) */ default Roles minus(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() ? NONE : other.isEmpty() ? this : new DifferenceRoles(this, other); }
/** * Get the disjunction of this collection and another. * * @param other the other roles collection (must not be {@code null}) * @return the disjunction (not {@code null}) */ default Roles xor(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() ? other : other.isEmpty() ? this : new DisjunctionRoles(this, other); }
/** * Get the intersection of this collection and another. * * @param other the other roles collection (must not be {@code null}) * @return the intersection (not {@code null}) */ default Roles and(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() || other.isEmpty() ? NONE : new IntersectionRoles(this, other); }
/** * Get the union of this collection and another. * * @param other the other roles collection (must not be {@code null}) * @return the union (not {@code null}) */ default Roles or(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() ? other : other.isEmpty() ? this : new UnionRoles(this, other); }
/** * Get a roles collection which adds a suffix to all role names. * * @param suffix the suffix to add (must not be {@code null}) * @return the new roles collection (not {@code null}) */ default Roles addSuffix(String suffix) { Assert.checkNotNullParam("suffix", suffix); return suffix.isEmpty() ? this : isEmpty() ? NONE : new AddSuffixRoles(this, suffix); }
/** * Get a roles collection which adds a prefix to all role names. * * @param prefix the prefix to add (must not be {@code null}) * @return the new roles collection (not {@code null}) */ default Roles addPrefix(String prefix) { Assert.checkNotNullParam("prefix", prefix); return prefix.isEmpty() ? this : isEmpty() ? NONE : new AddPrefixRoles(this, prefix); }
/** * Get the intersection of this collection and another. * * @param other the other roles collection (must not be {@code null}) * @return the intersection (not {@code null}) */ default Roles and(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() || other.isEmpty() ? NONE : new IntersectionRoles(this, other); }
/** * Get a roles collection which consists of the roles in this collection minus the roles in the other collection. * * @param other the other collection (must not be {@code null}) * @return the difference (not {@code null}) */ default Roles minus(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() ? NONE : other.isEmpty() ? this : new DifferenceRoles(this, other); }
/** * Get the union of this collection and another. * * @param other the other roles collection (must not be {@code null}) * @return the union (not {@code null}) */ default Roles or(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() ? other : other.isEmpty() ? this : new UnionRoles(this, other); }
/** * Get the intersection of this collection and another. * * @param other the other roles collection (must not be {@code null}) * @return the intersection (not {@code null}) */ default Roles and(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() || other.isEmpty() ? NONE : new IntersectionRoles(this, other); }
/** * Get the union of this collection and another. * * @param other the other roles collection (must not be {@code null}) * @return the union (not {@code null}) */ default Roles or(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() ? other : other.isEmpty() ? this : new UnionRoles(this, other); }
/** * Get the disjunction of this collection and another. * * @param other the other roles collection (must not be {@code null}) * @return the disjunction (not {@code null}) */ default Roles xor(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() ? other : other.isEmpty() ? this : new DisjunctionRoles(this, other); }
/** * Get a roles collection which consists of the roles in this collection minus the roles in the other collection. * * @param other the other collection (must not be {@code null}) * @return the difference (not {@code null}) */ default Roles minus(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() ? NONE : other.isEmpty() ? this : new DifferenceRoles(this, other); }
/** * Get the disjunction of this collection and another. * * @param other the other roles collection (must not be {@code null}) * @return the disjunction (not {@code null}) */ default Roles xor(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() ? other : other.isEmpty() ? this : new DisjunctionRoles(this, other); }
/** * Get the union of this collection and another. * * @param other the other roles collection (must not be {@code null}) * @return the union (not {@code null}) */ default Roles or(Roles other) { Assert.checkNotNullParam("other", other); return isEmpty() ? other : other.isEmpty() ? this : new UnionRoles(this, other); }
/** * Get a roles collection which adds a suffix to all role names. * * @param suffix the suffix to add (must not be {@code null}) * @return the new roles collection (not {@code null}) */ default Roles addSuffix(String suffix) { Assert.checkNotNullParam("suffix", suffix); return suffix.isEmpty() ? this : isEmpty() ? NONE : new AddSuffixRoles(this, suffix); }
/** * Get a roles collection which adds a suffix to all role names. * * @param suffix the suffix to add (must not be {@code null}) * @return the new roles collection (not {@code null}) */ default Roles addSuffix(String suffix) { Assert.checkNotNullParam("suffix", suffix); return suffix.isEmpty() ? this : isEmpty() ? NONE : new AddSuffixRoles(this, suffix); }
/** * Get a roles collection which adds a prefix to all role names. * * @param prefix the prefix to add (must not be {@code null}) * @return the new roles collection (not {@code null}) */ default Roles addPrefix(String prefix) { Assert.checkNotNullParam("prefix", prefix); return prefix.isEmpty() ? this : isEmpty() ? NONE : new AddPrefixRoles(this, prefix); }
/** * Get a roles collection which adds a prefix to all role names. * * @param prefix the prefix to add (must not be {@code null}) * @return the new roles collection (not {@code null}) */ default Roles addPrefix(String prefix) { Assert.checkNotNullParam("prefix", prefix); return prefix.isEmpty() ? this : isEmpty() ? NONE : new AddPrefixRoles(this, prefix); }
/** * Get a roles collection which adds a prefix to all role names. * * @param prefix the prefix to add (must not be {@code null}) * @return the new roles collection (not {@code null}) */ default Roles addPrefix(String prefix) { Assert.checkNotNullParam("prefix", prefix); return prefix.isEmpty() ? this : isEmpty() ? NONE : new AddPrefixRoles(this, prefix); }