Java 类org.apache.commons.lang3.exception.CloneFailedException 实例源码

项目:Gaffer    文件:AddGraph.java   
@Override
public AddGraph shallowClone() throws CloneFailedException {
    final Builder builder = new Builder()
            .graphId(graphId)
            .schema(schema)
            .storeProperties(storeProperties)
            .parentSchemaIds(parentSchemaIds)
            .parentPropertiesId(parentPropertiesId)
            .options(this.options)
            .isPublic(this.isPublic);

    if (null != graphAuths) {
        builder.graphAuths(graphAuths.toArray(new String[graphAuths.size()]));
    }

    return builder.build();
}
项目:Gaffer    文件:RemoveGraph.java   
@Override
public RemoveGraph shallowClone() throws CloneFailedException {
    return new RemoveGraph.Builder()
            .graphId(graphId)
            .options(options)
            .build();
}
项目:Gaffer    文件:Filter.java   
@Override
public Filter shallowClone() throws CloneFailedException {
    return new Filter.Builder()
            .input(input)
            .entities(entities)
            .edges(edges)
            .globalElements(globalElements)
            .globalEdges(globalEdges)
            .globalEntities(globalEntities)
            .options(options)
            .build();
}
项目:Gaffer    文件:Aggregate.java   
@Override
public Aggregate shallowClone() throws CloneFailedException {
    return new Aggregate.Builder()
            .input(input)
            .options(options)
            .edges(edges)
            .entities(entities)
            .build();
}
项目:Gaffer    文件:Transform.java   
@Override
public Transform shallowClone() throws CloneFailedException {
    return new Transform.Builder()
            .input(input)
            .options(options)
            .edges(edges)
            .entities(entities)
            .build();
}
项目:Gaffer    文件:Map.java   
@Override
public Map<I, O> shallowClone() throws CloneFailedException {
    final Map<I, O> clone = new Map<>();
    for (final Function func : functions) {
        clone.getFunctions().add(func);
    }
    clone.setInput(input);
    clone.setOptions(options);
    return clone;
}
项目:Gaffer    文件:OperationChain.java   
public OperationChain<OUT> shallowClone() throws CloneFailedException {
    final OperationChain<OUT> clone = new OperationChain<>();
    clone.setOptions(options);
    for (final Operation operation : operations) {
        clone.getOperations().add(operation.shallowClone());
    }
    return clone;
}
项目:Gaffer    文件:InputImpl.java   
@Override
public Operation shallowClone() throws CloneFailedException {
    return new InputImpl.Builder()
            .optionalField1(optionalField1)
            .optionalField2(optionalField2)
            .requiredField1(requiredField1)
            .requiredField2(requiredField2)
            .input(input)
            .options(options)
            .build();
}
项目:Gaffer    文件:GetSchema.java   
@Override
public GetSchema shallowClone() throws CloneFailedException {
    return new Builder()
            .compact(compact)
            .options(options)
            .build();
}
项目:astor    文件:ObjectUtilsTest.java   
/**
 * Tests {@link ObjectUtils#clone(Object)} with an uncloneable object.
 */
public void testCloneOfUncloneable() {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.clone(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        assertEquals(NoSuchMethodException.class, e.getCause().getClass());
    }
}
项目:astor    文件:ObjectUtilsTest.java   
/**
 * Tests {@link ObjectUtils#cloneIfPossible(Object)} with an uncloneable object.
 */
public void testPossibleCloneOfUncloneable() {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.cloneIfPossible(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        assertEquals(NoSuchMethodException.class, e.getCause().getClass());
    }
}
项目:astor    文件:ObjectUtilsTest.java   
/**
 * Tests {@link ObjectUtils#clone(Object)} with an uncloneable object.
 */
@Test(expected = NoSuchMethodException.class)
public void testCloneOfUncloneable() throws Throwable {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.clone(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        throw e.getCause();
    }
}
项目:astor    文件:ObjectUtilsTest.java   
/**
 * Tests {@link ObjectUtils#cloneIfPossible(Object)} with an uncloneable object.
 */
@Test(expected = NoSuchMethodException.class)
public void testPossibleCloneOfUncloneable() throws Throwable {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.cloneIfPossible(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        throw e.getCause();
    }
}
项目:astor    文件:ObjectUtilsTest.java   
/**
 * Tests {@link ObjectUtils#clone(Object)} with an uncloneable object.
 */
@Test(expected = NoSuchMethodException.class)
public void testCloneOfUncloneable() throws Throwable {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.clone(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        throw e.getCause();
    }
}
项目:astor    文件:ObjectUtilsTest.java   
/**
 * Tests {@link ObjectUtils#cloneIfPossible(Object)} with an uncloneable object.
 */
@Test(expected = NoSuchMethodException.class)
public void testPossibleCloneOfUncloneable() throws Throwable {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.cloneIfPossible(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        throw e.getCause();
    }
}
项目:gwt-commons-lang3    文件:ObjectUtilsTest.java   
/**
 * Tests {@link ObjectUtils#clone(Object)} with an uncloneable object.
 *
 * @throws java.lang.Throwable because we expect this to fail
 */
@Test(expected = NoSuchMethodException.class)
public void testCloneOfUncloneable() throws Throwable {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.clone(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        throw e.getCause();
    }
}
项目:gwt-commons-lang3    文件:ObjectUtilsTest.java   
/**
 * Tests {@link ObjectUtils#cloneIfPossible(Object)} with an uncloneable object.
 *
 * @throws java.lang.Throwable because we expect this to fail
 */
@Test(expected = NoSuchMethodException.class)
public void testPossibleCloneOfUncloneable() throws Throwable {
    final UncloneableString string = new UncloneableString("apache");
    try {
        ObjectUtils.cloneIfPossible(string);
        fail("Thrown " + CloneFailedException.class.getName() + " expected");
    } catch (final CloneFailedException e) {
        throw e.getCause();
    }
}
项目:Gaffer    文件:FederatedOperationChain.java   
public FederatedOperationChain<O_ITEM> shallowClone() throws CloneFailedException {
    return new FederatedOperationChain.Builder<O_ITEM>()
            .operationChain(operationChain.shallowClone())
            .options(options)
            .build();
}
项目:Gaffer    文件:GetAllGraphIds.java   
@Override
public GetAllGraphIds shallowClone() throws CloneFailedException {
    return new Builder()
            .options(options)
            .build();
}
项目:Gaffer    文件:DiscardOutput.java   
@Override
public DiscardOutput shallowClone() throws CloneFailedException {
    return new DiscardOutput.Builder()
            .options(options)
            .build();
}
项目:Gaffer    文件:TestOperationsImpl.java   
@Override
public Operation shallowClone() throws CloneFailedException {
    return null;
}
项目:Gaffer    文件:TestUnmodifiableOperationsImpl.java   
@Override
public Operation shallowClone() throws CloneFailedException {
    return null;
}
项目:Gaffer    文件:Operation.java   
/**
 * Operation implementations should ensure a ShallowClone method is implemented.
 * Performs a shallow clone. Creates a new instance and copies the fields across.
 * It does not clone the fields.
 *
 * If the operation contains nested operations, these must also be cloned.
 *
 * @return shallow clone
 * @throws CloneFailedException if a Clone error occurs
 */
Operation shallowClone() throws CloneFailedException;