16
|
1 package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations;
|
|
2
|
|
3 import java.nio.ByteBuffer;
|
50
|
4
|
18
|
5 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command;
|
50
|
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.EditableNode;
|
|
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.PutAttribute;
|
|
8 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either;
|
|
9 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error;
|
16
|
10
|
50
|
11 public class PutAttributeOperation implements NodeOperation
|
16
|
12 {
|
50
|
13 private final String key;
|
|
14 private final ByteBuffer value;
|
|
15
|
|
16 public PutAttributeOperation(String _key,ByteBuffer _value)
|
|
17 {
|
|
18 key = _key;
|
|
19 value = _value;
|
|
20 }
|
|
21
|
18
|
22 @Override
|
|
23 public Command getCommand()
|
|
24 {
|
50
|
25 return Command.PUT_ATTRIBUTE;
|
18
|
26 }
|
|
27
|
50
|
28 @Override
|
|
29 public <T extends EditableNode<T>> Either<Error, T> invoke(T _target)
|
|
30 {
|
|
31 PutAttribute putAttribute = new PutAttribute(key,value);
|
|
32 return putAttribute.edit(_target);
|
|
33 }
|
33
|
34 } |