@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(); }
@Override public RemoveGraph shallowClone() throws CloneFailedException { return new RemoveGraph.Builder() .graphId(graphId) .options(options) .build(); }
@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(); }
@Override public Aggregate shallowClone() throws CloneFailedException { return new Aggregate.Builder() .input(input) .options(options) .edges(edges) .entities(entities) .build(); }
@Override public Transform shallowClone() throws CloneFailedException { return new Transform.Builder() .input(input) .options(options) .edges(edges) .entities(entities) .build(); }
@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; }
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; }
@Override public Operation shallowClone() throws CloneFailedException { return new InputImpl.Builder() .optionalField1(optionalField1) .optionalField2(optionalField2) .requiredField1(requiredField1) .requiredField2(requiredField2) .input(input) .options(options) .build(); }
@Override public GetSchema shallowClone() throws CloneFailedException { return new Builder() .compact(compact) .options(options) .build(); }
/** * 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()); } }
/** * 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()); } }
/** * 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(); } }
/** * 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(); } }
/** * 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(); } }
/** * 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(); } }
public FederatedOperationChain<O_ITEM> shallowClone() throws CloneFailedException { return new FederatedOperationChain.Builder<O_ITEM>() .operationChain(operationChain.shallowClone()) .options(options) .build(); }
@Override public GetAllGraphIds shallowClone() throws CloneFailedException { return new Builder() .options(options) .build(); }
@Override public DiscardOutput shallowClone() throws CloneFailedException { return new DiscardOutput.Builder() .options(options) .build(); }
@Override public Operation shallowClone() throws CloneFailedException { return null; }
/** * 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;