com.sun.xml.ws.policy
Class AssertionSet

java.lang.Object
  extended by 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
 int compareTo(AssertionSet that)
          An Comparable<T>.compareTo(T o) interface method implementation.
 boolean contains(QName assertionName)
          Returns true if the assertion set contains the assertion name specified in its vocabulary
static 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)
          An Object.equals(Object obj) method override.
 Collection<PolicyAssertion> get(QName name)
          Searches for assertions with given name.
 int hashCode()
          An Object.hashCode() method override.
 boolean isEmpty()
          Returns true if this assertion set contains no assertions.
 Iterator<PolicyAssertion> iterator()
          Returns an iterator over a set of child policy assertion objects.
 String toString()
          An Object.toString() method override.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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 be null - 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 be null.
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 interface Iterable<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()
Returns true 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 vocabulary false otherwise.

compareTo

public int compareTo(AssertionSet that)
An Comparable<T>.compareTo(T o) interface method implementation.

Specified by:
compareTo in interface Comparable<AssertionSet>
Parameters:
that - other alternative to compare with

equals

public boolean equals(Object obj)
An Object.equals(Object obj) method override.

Overrides:
equals in class Object

hashCode

public int hashCode()
An Object.hashCode() method override.

Overrides:
hashCode in class Object

toString

public String toString()
An Object.toString() method override.

Overrides:
toString in class Object


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.