java.security.cert
Class CollectionCertStoreParameters

java.lang.Object
  extended by java.security.cert.CollectionCertStoreParameters
All Implemented Interfaces:
Cloneable, CertStoreParameters

public class CollectionCertStoreParameters
extends Object
implements CertStoreParameters

An implementation of CertStoreParameters with a simple, in-memory Collection of certificates and certificate revocation list.

Note that this class is not thread-safe, and its underlying collection may be changed at any time.

Since:
1.4
See Also:
CertStore

Constructor Summary
CollectionCertStoreParameters()
          Creates a new CollectionCertStoreParameters with an empty, immutable collection.
CollectionCertStoreParameters(Collection<?> collection)
          Create a new CollectionCertStoreParameters with the specified collection.
 
Method Summary
 Object clone()
          This method may be called to create a new copy of the Object.
 Collection<?> getCollection()
          Return the underlying collection.
 String toString()
          Return a string representation of these parameters.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollectionCertStoreParameters

public CollectionCertStoreParameters()
Creates a new CollectionCertStoreParameters with an empty, immutable collection.


CollectionCertStoreParameters

public CollectionCertStoreParameters(Collection<?> collection)
Create a new CollectionCertStoreParameters with the specified collection. The argument is not copied, and subsequent changes to the collection will change this class's collection.

Parameters:
collection - The collection.
Throws:
NullPointerException - If collection is null.
Method Detail

clone

public Object clone()
Description copied from class: Object
This method may be called to create a new copy of the Object. The typical behavior is as follows:

However, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override Object.equals(Object).

If the Object you call clone() on does not implement Cloneable (which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.

Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.

All array types implement Cloneable, and override this method as follows (it should never fail):

 public Object clone()
 {
   try
     {
       super.clone();
     }
   catch (CloneNotSupportedException e)
     {
       throw new InternalError(e.getMessage());
     }
 }
 

Specified by:
clone in interface CertStoreParameters
Overrides:
clone in class Object
Returns:
a copy of the Object
See Also:
Cloneable

getCollection

public Collection<?> getCollection()
Return the underlying collection. The collection is not copied before being returned, so callers may update the collection that is returned.

Returns:
The collection.

toString

public String toString()
Return a string representation of these parameters.

Overrides:
toString in class Object
Returns:
The string representation of these parameters.
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)