Mercurial > hg > Database > jungle-sharp
comparison Main/jungle-main/store/transformer/PutAttribute.cs @ 20:1f99e150f336
fix folder and add Object Mapper.
author | Kazuma Takeda |
---|---|
date | Thu, 15 Dec 2016 22:52:48 +0900 |
parents | |
children | f7616084d3ab |
comparison
equal
deleted
inserted
replaced
19:0865819106cf | 20:1f99e150f336 |
---|---|
1 using UnityEngine; | |
2 using System.Collections; | |
3 | |
4 namespace JungleDB { | |
5 public class PutAttribute : NodeEditor { | |
6 private string key; | |
7 private byte[] value; | |
8 | |
9 public PutAttribute(string _key, byte[] _value) | |
10 { | |
11 key = _key; | |
12 value = _value; | |
13 } | |
14 | |
15 public Either<Error,LoggingNode> _edit(LoggingNode _e) | |
16 { | |
17 Either<Error,LoggingNode> either = _e.getAttributes().put(key,value); | |
18 if(either.isA()){ | |
19 // error | |
20 return either; | |
21 } | |
22 return DefaultEither<Error, LoggingNode>.newB(either.b()); | |
23 } | |
24 | |
25 public Either<Error, LoggingNode> edit(TreeNode _e) { | |
26 LoggingNode logNode = wrap(_e); | |
27 return _edit(logNode); | |
28 } | |
29 | |
30 public LoggingNode wrap(TreeNode node) { | |
31 return new LoggingNode(node); | |
32 } | |
33 | |
34 public LoggingNode wrap(TreeNode node, OperationLog op) { | |
35 return new LoggingNode(node, op); | |
36 } | |
37 } | |
38 } |