Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sceleton for delats for embedded lists
- Loading branch information
1 parent
4dec5f0
commit b41e7ed
Showing
2 changed files
with
152 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
core/src/main/java/com/orientechnologies/orient/core/record/impl/UpdateDeltaValueType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,69 @@ | |||
/* | |||
* Copyright 2018 OrientDB. | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
package com.orientechnologies.orient.core.record.impl; | |||
|
|||
/** | |||
* | |||
* @author mdjurovi | |||
*/ | |||
public enum UpdateDeltaValueType { | |||
UPDATE, | |||
LIST_UPDATE, | |||
LIST_ELEMENT_ADD, | |||
LIST_ELEMENT_REMOVE, | |||
LIST_ELEMENT_UPDATE, | |||
LIST_ELEMENT_CHANGE, | |||
UNKNOWN; | |||
|
|||
public static byte getOrd(UpdateDeltaValueType type){ | |||
switch (type){ | |||
case UPDATE: | |||
return 1; | |||
case LIST_UPDATE: | |||
return 2; | |||
case LIST_ELEMENT_ADD: | |||
return 4; | |||
case LIST_ELEMENT_REMOVE: | |||
return 8; | |||
case LIST_ELEMENT_UPDATE: | |||
return 16; | |||
case LIST_ELEMENT_CHANGE: | |||
return 32; | |||
default: | |||
return 0; | |||
} | |||
} | |||
|
|||
public static UpdateDeltaValueType fromOrd(byte ordValue){ | |||
switch (ordValue){ | |||
case 1: | |||
return UPDATE; | |||
case 2: | |||
return LIST_UPDATE; | |||
case 4: | |||
return LIST_ELEMENT_ADD; | |||
case 8: | |||
return LIST_ELEMENT_REMOVE; | |||
case 16: | |||
return LIST_ELEMENT_UPDATE; | |||
case 32: | |||
return LIST_ELEMENT_CHANGE; | |||
case 0: | |||
default: | |||
return UNKNOWN; | |||
} | |||
} | |||
} |