Search in sources :

Example 1 with ListAddAllOperation

use of com.hazelcast.collection.impl.list.operations.ListAddAllOperation in project hazelcast by hazelcast.

the class CollectionDataSerializerHook method createFactory.

@Override
public DataSerializableFactory createFactory() {
    ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[QUEUE_TRANSACTION_LOG_RECORD + 1];
    constructors[COLLECTION_ADD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionAddOperation();
        }
    };
    constructors[COLLECTION_ADD_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionAddBackupOperation();
        }
    };
    constructors[LIST_ADD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListAddOperation();
        }
    };
    constructors[LIST_GET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListGetOperation();
        }
    };
    constructors[COLLECTION_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionRemoveOperation();
        }
    };
    constructors[COLLECTION_REMOVE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionRemoveBackupOperation();
        }
    };
    constructors[COLLECTION_SIZE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionSizeOperation();
        }
    };
    constructors[COLLECTION_CLEAR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionClearOperation();
        }
    };
    constructors[COLLECTION_CLEAR_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionClearBackupOperation();
        }
    };
    constructors[LIST_SET] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListSetOperation();
        }
    };
    constructors[LIST_SET_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListSetBackupOperation();
        }
    };
    constructors[LIST_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListRemoveOperation();
        }
    };
    constructors[LIST_INDEX_OF] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListIndexOfOperation();
        }
    };
    constructors[COLLECTION_CONTAINS] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionContainsOperation();
        }
    };
    constructors[COLLECTION_ADD_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionAddAllOperation();
        }
    };
    constructors[COLLECTION_ADD_ALL_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionAddAllBackupOperation();
        }
    };
    constructors[LIST_ADD_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListAddAllOperation();
        }
    };
    constructors[LIST_SUB] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListSubOperation();
        }
    };
    constructors[COLLECTION_COMPARE_AND_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionCompareAndRemoveOperation();
        }
    };
    constructors[COLLECTION_GET_ALL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionGetAllOperation();
        }
    };
    constructors[COLLECTION_EVENT_FILTER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionEventFilter();
        }
    };
    constructors[COLLECTION_EVENT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionEvent();
        }
    };
    constructors[COLLECTION_ITEM] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionItem();
        }
    };
    constructors[COLLECTION_RESERVE_ADD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionReserveAddOperation();
        }
    };
    constructors[COLLECTION_RESERVE_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionReserveRemoveOperation();
        }
    };
    constructors[COLLECTION_TXN_ADD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionTxnAddOperation();
        }
    };
    constructors[COLLECTION_TXN_ADD_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionTxnAddBackupOperation();
        }
    };
    constructors[COLLECTION_TXN_REMOVE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionTxnRemoveOperation();
        }
    };
    constructors[COLLECTION_TXN_REMOVE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionTxnRemoveBackupOperation();
        }
    };
    constructors[COLLECTION_PREPARE] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionPrepareOperation();
        }
    };
    constructors[COLLECTION_PREPARE_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionPrepareBackupOperation();
        }
    };
    constructors[COLLECTION_ROLLBACK] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionRollbackOperation();
        }
    };
    constructors[COLLECTION_ROLLBACK_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionRollbackBackupOperation();
        }
    };
    constructors[TX_COLLECTION_ITEM] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new TxCollectionItem();
        }
    };
    constructors[TX_ROLLBACK] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionTransactionRollbackOperation();
        }
    };
    constructors[LIST_REPLICATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListReplicationOperation();
        }
    };
    constructors[SET_REPLICATION] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new SetReplicationOperation();
        }
    };
    constructors[COLLECTION_IS_EMPTY] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionIsEmptyOperation();
        }
    };
    constructors[TXN_COMMIT] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionCommitOperation();
        }
    };
    constructors[TXN_COMMIT_BACKUP] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionCommitBackupOperation();
        }
    };
    constructors[SET_CONTAINER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new SetContainer();
        }
    };
    constructors[LIST_CONTAINER] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new ListContainer();
        }
    };
    constructors[COLLECTION_TRANSACTION_LOG_RECORD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new CollectionTransactionLogRecord();
        }
    };
    constructors[QUEUE_TRANSACTION_LOG_RECORD] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {

        public IdentifiedDataSerializable createNew(Integer arg) {
            return new QueueTransactionLogRecord();
        }
    };
    return new ArrayDataSerializableFactory(constructors);
}
Also used : CollectionAddAllBackupOperation(com.hazelcast.collection.impl.collection.operations.CollectionAddAllBackupOperation) ListAddAllOperation(com.hazelcast.collection.impl.list.operations.ListAddAllOperation) CollectionTransactionLogRecord(com.hazelcast.collection.impl.txncollection.CollectionTransactionLogRecord) CollectionReserveAddOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionReserveAddOperation) ListSetBackupOperation(com.hazelcast.collection.impl.list.operations.ListSetBackupOperation) IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) CollectionClearBackupOperation(com.hazelcast.collection.impl.collection.operations.CollectionClearBackupOperation) ListReplicationOperation(com.hazelcast.collection.impl.list.operations.ListReplicationOperation) CollectionPrepareBackupOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionPrepareBackupOperation) ListGetOperation(com.hazelcast.collection.impl.list.operations.ListGetOperation) CollectionTransactionRollbackOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionTransactionRollbackOperation) CollectionRollbackOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionRollbackOperation) ListIndexOfOperation(com.hazelcast.collection.impl.list.operations.ListIndexOfOperation) SetReplicationOperation(com.hazelcast.collection.impl.set.operations.SetReplicationOperation) CollectionContainsOperation(com.hazelcast.collection.impl.collection.operations.CollectionContainsOperation) CollectionCompareAndRemoveOperation(com.hazelcast.collection.impl.collection.operations.CollectionCompareAndRemoveOperation) CollectionClearOperation(com.hazelcast.collection.impl.collection.operations.CollectionClearOperation) CollectionTxnAddBackupOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionTxnAddBackupOperation) CollectionAddBackupOperation(com.hazelcast.collection.impl.collection.operations.CollectionAddBackupOperation) CollectionSizeOperation(com.hazelcast.collection.impl.collection.operations.CollectionSizeOperation) CollectionCommitOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionCommitOperation) CollectionGetAllOperation(com.hazelcast.collection.impl.collection.operations.CollectionGetAllOperation) CollectionAddOperation(com.hazelcast.collection.impl.collection.operations.CollectionAddOperation) SetContainer(com.hazelcast.collection.impl.set.SetContainer) CollectionTxnAddOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionTxnAddOperation) CollectionRemoveOperation(com.hazelcast.collection.impl.collection.operations.CollectionRemoveOperation) ListContainer(com.hazelcast.collection.impl.list.ListContainer) ListAddOperation(com.hazelcast.collection.impl.list.operations.ListAddOperation) CollectionIsEmptyOperation(com.hazelcast.collection.impl.collection.operations.CollectionIsEmptyOperation) QueueTransactionLogRecord(com.hazelcast.collection.impl.txnqueue.QueueTransactionLogRecord) CollectionReserveRemoveOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionReserveRemoveOperation) CollectionTxnRemoveBackupOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionTxnRemoveBackupOperation) CollectionRemoveBackupOperation(com.hazelcast.collection.impl.collection.operations.CollectionRemoveBackupOperation) CollectionPrepareOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionPrepareOperation) ConstructorFunction(com.hazelcast.util.ConstructorFunction) ListSubOperation(com.hazelcast.collection.impl.list.operations.ListSubOperation) CollectionTxnRemoveOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionTxnRemoveOperation) CollectionAddAllOperation(com.hazelcast.collection.impl.collection.operations.CollectionAddAllOperation) CollectionRollbackBackupOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionRollbackBackupOperation) ListSetOperation(com.hazelcast.collection.impl.list.operations.ListSetOperation) ListRemoveOperation(com.hazelcast.collection.impl.list.operations.ListRemoveOperation) ArrayDataSerializableFactory(com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory) CollectionCommitBackupOperation(com.hazelcast.collection.impl.txncollection.operations.CollectionCommitBackupOperation)

Example 2 with ListAddAllOperation

use of com.hazelcast.collection.impl.list.operations.ListAddAllOperation in project hazelcast by hazelcast.

the class ListProxyImpl method addAll.

@Override
public boolean addAll(int index, Collection<? extends E> c) {
    checkObjectNotNull(c);
    checkIndexNotNegative(index);
    List<Data> valueList = new ArrayList<Data>(c.size());
    final NodeEngine nodeEngine = getNodeEngine();
    for (E e : c) {
        checkObjectNotNull(e);
        valueList.add(nodeEngine.toData(e));
    }
    final ListAddAllOperation operation = new ListAddAllOperation(name, index, valueList);
    final Boolean result = invoke(operation);
    return result;
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) ListAddAllOperation(com.hazelcast.collection.impl.list.operations.ListAddAllOperation) ArrayList(java.util.ArrayList) Data(com.hazelcast.nio.serialization.Data)

Aggregations

ListAddAllOperation (com.hazelcast.collection.impl.list.operations.ListAddAllOperation)2 CollectionAddAllBackupOperation (com.hazelcast.collection.impl.collection.operations.CollectionAddAllBackupOperation)1 CollectionAddAllOperation (com.hazelcast.collection.impl.collection.operations.CollectionAddAllOperation)1 CollectionAddBackupOperation (com.hazelcast.collection.impl.collection.operations.CollectionAddBackupOperation)1 CollectionAddOperation (com.hazelcast.collection.impl.collection.operations.CollectionAddOperation)1 CollectionClearBackupOperation (com.hazelcast.collection.impl.collection.operations.CollectionClearBackupOperation)1 CollectionClearOperation (com.hazelcast.collection.impl.collection.operations.CollectionClearOperation)1 CollectionCompareAndRemoveOperation (com.hazelcast.collection.impl.collection.operations.CollectionCompareAndRemoveOperation)1 CollectionContainsOperation (com.hazelcast.collection.impl.collection.operations.CollectionContainsOperation)1 CollectionGetAllOperation (com.hazelcast.collection.impl.collection.operations.CollectionGetAllOperation)1 CollectionIsEmptyOperation (com.hazelcast.collection.impl.collection.operations.CollectionIsEmptyOperation)1 CollectionRemoveBackupOperation (com.hazelcast.collection.impl.collection.operations.CollectionRemoveBackupOperation)1 CollectionRemoveOperation (com.hazelcast.collection.impl.collection.operations.CollectionRemoveOperation)1 CollectionSizeOperation (com.hazelcast.collection.impl.collection.operations.CollectionSizeOperation)1 ListContainer (com.hazelcast.collection.impl.list.ListContainer)1 ListAddOperation (com.hazelcast.collection.impl.list.operations.ListAddOperation)1 ListGetOperation (com.hazelcast.collection.impl.list.operations.ListGetOperation)1 ListIndexOfOperation (com.hazelcast.collection.impl.list.operations.ListIndexOfOperation)1 ListRemoveOperation (com.hazelcast.collection.impl.list.operations.ListRemoveOperation)1 ListReplicationOperation (com.hazelcast.collection.impl.list.operations.ListReplicationOperation)1