Package com.sun.xml.ws.policy
Class AssertionSet
- java.lang.Object
-
- com.sun.xml.ws.policy.AssertionSet
-
- All Implemented Interfaces:
Comparable<AssertionSet>
,Iterable<PolicyAssertion>
public final class AssertionSet extends Object implements Iterable<PolicyAssertion>, Comparable<AssertionSet>
The AssertionSet is a set of assertions. It represents a single policy alternative.- Author:
- Fabian Ritzmann, Marek Potociar
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(AssertionSet that)
AnComparable<T>.compareTo(T o)
interface method implementation.boolean
contains(QName assertionName)
Returns true if the assertion set contains the assertion name specified in its vocabularystatic AssertionSet
createAssertionSet(Collection<? extends PolicyAssertion> assertions)
Creates and returns new assertion set holding a set of provided policy assertions.static AssertionSet
createMergedAssertionSet(Collection<AssertionSet> alternatives)
Creates and returns new assertion set holding content of all provided policy assertion sets.static AssertionSet
emptyAssertionSet()
boolean
equals(Object obj)
AnObject.equals(Object obj)
method override.Collection<PolicyAssertion>
get(QName name)
Searches for assertions with given name.int
hashCode()
AnObject.hashCode()
method override.boolean
isEmpty()
Returnstrue
if this assertion set contains no assertions.Iterator<PolicyAssertion>
iterator()
Returns an iterator over a set of child policy assertion objects.String
toString()
AnObject.toString()
method override.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
createMergedAssertionSet
public static AssertionSet createMergedAssertionSet(Collection<AssertionSet> alternatives)
Creates and returns new assertion set holding content of all provided policy assertion sets.
This method should not be used to perform a merge of general Policy instances. A client should be aware of the method's result meaning and the difference between merge of Policy instances and merge of AssertionSet instances.- Parameters:
alternatives
- collection of provided policy assertion sets which content is to be stored in the assertion set. May benull
- empty assertion set is returned in such case.- Returns:
- new instance of assertion set holding the content of all provided policy assertion sets.
-
createAssertionSet
public static AssertionSet createAssertionSet(Collection<? extends PolicyAssertion> assertions)
Creates and returns new assertion set holding a set of provided policy assertions.- Parameters:
assertions
- collection of provided policy assertions to be stored in the assertion set. May benull
.- Returns:
- new instance of assertion set holding the provided policy assertions
-
emptyAssertionSet
public static AssertionSet emptyAssertionSet()
-
iterator
public Iterator<PolicyAssertion> iterator()
Returns an iterator over a set of child policy assertion objects.- Specified by:
iterator
in interfaceIterable<PolicyAssertion>
- Returns:
- policy assertion Iterator.
-
get
public Collection<PolicyAssertion> get(QName name)
Searches for assertions with given name. Only assertions that are contained as immediate children of the assertion set are searched, i.e. nested policies are not searched.- Parameters:
name
- The fully qualified name of searched assertion- Returns:
- List of all assertions matching the requested name. If no assertions are found, the returned list is empty
(i.e.
null
value is never returned).
-
isEmpty
public boolean isEmpty()
Returnstrue
if this assertion set contains no assertions.- Returns:
true
if this assertion set contains no assertions.
-
contains
public boolean contains(QName assertionName)
Returns true if the assertion set contains the assertion name specified in its vocabulary- Parameters:
assertionName
- the fully qualified name of the assertion- Returns:
true
, if an assertion with the given name could be found in the assertion set vocabularyfalse
otherwise.
-
compareTo
public int compareTo(AssertionSet that)
AnComparable<T>.compareTo(T o)
interface method implementation.- Specified by:
compareTo
in interfaceComparable<AssertionSet>
- Parameters:
that
- other alternative to compare with
-
equals
public boolean equals(Object obj)
AnObject.equals(Object obj)
method override.
-
hashCode
public int hashCode()
AnObject.hashCode()
method override.
-
-