Welcome to mirror list, hosted at ThFree Co, Russian Federation.

X509CollectionStoreParameters.java « x509 « spongycastle « org « java « main « src « prov - gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: eb38877105214ab03c6f20995e71c43264525967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package org.spongycastle.x509;

import java.util.ArrayList;
import java.util.Collection;

/**
 * This class contains a collection for collection based <code>X509Store</code>s.
 * 
 * @see org.spongycastle.x509.X509Store
 * 
 */
public class X509CollectionStoreParameters
    implements X509StoreParameters
{
    private Collection collection;

    /**
     * Constructor.
     * <p>
     * The collection is copied.
     * </p>
     * 
     * @param collection
     *            The collection containing X.509 object types.
     * @throws NullPointerException if <code>collection</code> is <code>null</code>.
     */
    public X509CollectionStoreParameters(Collection collection)
    {
        if (collection == null)
        {
            throw new NullPointerException("collection cannot be null");
        }
        this.collection = collection;
    }

    /**
     * Returns a shallow clone. The returned contents are not copied, so adding
     * or removing objects will effect this.
     * 
     * @return a shallow clone.
     */
    public Object clone()
    {
        return new X509CollectionStoreParameters(collection);
    }
    
    /**
     * Returns a copy of the <code>Collection</code>.
     * 
     * @return The <code>Collection</code>. Is never <code>null</code>.
     */
    public Collection getCollection()
    {
        return new ArrayList(collection);
    }
    
    /**
     * Returns a formatted string describing the parameters.
     * 
     * @return a formatted string describing the parameters
     */
    public String toString()
    {
        StringBuffer sb = new StringBuffer();
        sb.append("X509CollectionStoreParameters: [\n");
        sb.append("  collection: " + collection + "\n");
        sb.append("]");
        return sb.toString();
    }
}