Mercurial > hg > Database > jungle-network
view src/alice/jungle/operations/NetworkDeleteAttributeOperation.java @ 72:2520a5bd3dac
Added NetworkDeleteAttributeOperation and NetworkDeleteAttributeOperationTest
author | one |
---|---|
date | Tue, 15 Oct 2013 09:13:18 +0900 |
parents | |
children | 9e3198bf9547 |
line wrap: on
line source
package alice.jungle.operations; import java.nio.ByteBuffer; import org.msgpack.annotation.Message; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.DeleteAttribute; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.EditableNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; @Message public class NetworkDeleteAttributeOperation implements NodeOperation { //private final String key; private String key; public NetworkDeleteAttributeOperation() { key = null; } public NetworkDeleteAttributeOperation(String _key) { key = _key; } @Override public Command getCommand() { return Command.DELETE_ATTRIBUTE; } @Override public <T extends EditableNode<T>> Either<Error, T> invoke(T _target) { DeleteAttribute deleteAttribute = new DeleteAttribute(key); return deleteAttribute.edit(_target); } @Override public int getPosition() { return -1; } @Override public String getKey() { return key; } @Override public ByteBuffer getValue() { return null; } }