NIHVIVO-3523 Add convenience constructors to ArrayIdentifierBundle

This commit is contained in:
j2blake 2011-12-22 19:59:12 +00:00
parent 9d55acb2f3
commit 59f3cb6311
3 changed files with 14 additions and 9 deletions

View file

@ -3,12 +3,19 @@
package edu.cornell.mannlib.vitro.webapp.auth.identifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
/**
* Most common implementation of a List of Identifiers (IdentifierBundle).
* @author bdc34
*
* Most common implementation of a List of Identifiers (IdentifierBundle).
*/
public class ArrayIdentifierBundle extends ArrayList<Identifier> implements IdentifierBundle{
public class ArrayIdentifierBundle extends ArrayList<Identifier> implements
IdentifierBundle {
public ArrayIdentifierBundle(Collection<? extends Identifier> ids) {
super(ids);
}
public ArrayIdentifierBundle(Identifier... ids) {
this(Arrays.asList(ids));
}
}

View file

@ -74,8 +74,7 @@ public class SelfEditingPolicyTest extends AbstractTestClass {
IndividualImpl ind = new IndividualImpl();
ind.setURI(SELFEDITOR_URI);
ids = new ArrayIdentifierBundle();
ids.add(new HasProfile(SELFEDITOR_URI));
ids = new ArrayIdentifierBundle(new HasProfile(SELFEDITOR_URI));
}
@Test

View file

@ -94,8 +94,7 @@ public class SelfEditingPolicy_2_Test extends AbstractTestClass {
seIndividual = new IndividualImpl();
seIndividual.setURI(SELFEDITOR_URI);
ids = new ArrayIdentifierBundle();
ids.add(new HasProfile(SELFEDITOR_URI));
ids = new ArrayIdentifierBundle(new HasProfile(SELFEDITOR_URI));
// setLoggerLevel(SelfEditingPolicySetupTest.class, Level.DEBUG);
}