TransactionCreateBuilder asTransactionCreateBuilder()

in curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java [164:221]


    <T> TransactionCreateBuilder<T> asTransactionCreateBuilder(
            final T context, final CuratorMultiTransactionRecord transaction) {
        return new TransactionCreateBuilder<T>() {
            @Override
            public PathAndBytesable<T> withACL(List<ACL> aclList) {
                return withACL(aclList, false);
            }

            @Override
            public PathAndBytesable<T> withACL(List<ACL> aclList, boolean applyToParents) {
                CreateBuilderImpl.this.withACL(aclList, applyToParents);
                return this;
            }

            @Override
            public TransactionCreateBuilder2<T> withTtl(long ttl) {
                CreateBuilderImpl.this.withTtl(ttl);
                return this;
            }

            @Override
            public ACLPathAndBytesable<T> withMode(CreateMode mode) {
                CreateBuilderImpl.this.withMode(mode);
                return this;
            }

            @Override
            public ACLCreateModePathAndBytesable<T> compressed() {
                CreateBuilderImpl.this.compressed();
                return this;
            }

            @Override
            public ACLCreateModePathAndBytesable<T> uncompressed() {
                CreateBuilderImpl.this.uncompressed();
                return this;
            }

            @Override
            public T forPath(String path) throws Exception {
                return forPath(path, client.getDefaultData());
            }

            @Override
            public T forPath(String path, byte[] data) throws Exception {
                if (compress) {
                    data = client.getCompressionProvider().compress(path, data);
                }

                String fixedPath = client.fixForNamespace(path);
                transaction.add(
                        Op.create(fixedPath, data, acling.getAclList(path), createMode, ttl),
                        OperationType.CREATE,
                        path);
                return context;
            }
        };
    }