20
|
1 using UnityEngine;
|
|
2 using System.Collections;
|
|
3
|
|
4 namespace JungleDB {
|
|
5 public class NetworkPutAttributeOperation : NodeOperation {
|
|
6
|
|
7 public string Key;
|
|
8 public byte[] Value;
|
|
9
|
|
10 public NetworkPutAttributeOperation() {
|
|
11 this.Key = null;
|
|
12 this.Value = null;
|
|
13 }
|
|
14
|
|
15 public NetworkPutAttributeOperation(string key, byte[] value){
|
|
16 this.Key = key;
|
|
17 this.Value = value;
|
|
18 }
|
|
19
|
|
20 public Command getCommand () {
|
|
21 return Command.PUT_ATTRIBUTE;
|
|
22 }
|
|
23
|
|
24 public Either<Error, TreeNode> invoke (TreeNode target) {
|
|
25 return target.getAttributes().put(this.Key, this.Value);
|
|
26 }
|
|
27
|
|
28 public string getKey () {
|
|
29 return this.Key;
|
|
30 }
|
|
31
|
|
32 public int getPosition () {
|
|
33 return -1;
|
|
34 }
|
|
35
|
|
36 public byte[] getValue () {
|
|
37 return this.Value;
|
|
38 }
|
|
39 }
|
|
40 } |