com.sun.xml.ws.policy
Class AssertionSet

java.lang.Object
  extended by com.sun.xml.ws.policy.AssertionSet
All Implemented Interfaces:
java.lang.Comparable<AssertionSet>, java.lang.Iterable<PolicyAssertion>

public final class AssertionSet
extends java.lang.Object
implements java.lang.Iterable<PolicyAssertion>, java.lang.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(javax.xml.namespace.QName assertionName)
          Returns true if the assertion set contains the assertion name specified in its vocabulary
static AssertionSet createAssertionSet(java.util.Collection<? extends PolicyAssertion> assertions)
          Creates and returns new assertion set holding a set of provided policy assertions.
static AssertionSet createMergedAssertionSet(java.util.Collection<AssertionSet> alternatives)
          Creates and returns new assertion set holding content of all provided policy assertion sets.
static AssertionSet emptyAssertionSet()
           
 boolean equals(java.lang.Object obj)
          An Object.equals(Object obj) method override.
 java.util.Collection<PolicyAssertion> get(javax.xml.namespace.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.
 java.util.Iterator<PolicyAssertion> iterator()
          Returns an iterator over a set of child policy assertion objects.
 java.lang.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(java.util.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(java.util.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 java.util.Iterator<PolicyAssertion> iterator()
Returns an iterator over a set of child policy assertion objects.

Specified by:
iterator in interface java.lang.Iterable<PolicyAssertion>
Returns:
policy assertion Iterator.

get

public java.util.Collection<PolicyAssertion> get(javax.xml.namespace.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(javax.xml.namespace.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 java.lang.Comparable<AssertionSet>
Parameters:
that - other alternative to compare with

equals

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

Overrides:
equals in class java.lang.Object

hashCode

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

Overrides:
hashCode in class java.lang.Object

toString

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

Overrides:
toString in class java.lang.Object


Copyright © 2011 Sun Microsystems, Inc.. All Rights Reserved.