2222import static com .here .naksha .mom10 .MetaProperties .META ;
2323import static com .here .naksha .mom10 .MetaProperties .MODERATION_INFO ;
2424
25- import com .here .naksha .lib .core .models .geojson .implementation .XyzFeature ;
26- import com .here .naksha .lib .core .models .geojson .implementation .XyzProperties ;
27- import com .here .naksha .lib .core .models .geojson .implementation .namespaces .EChangeState ;
28- import com .here .naksha .lib .core .models .geojson .implementation .namespaces .EReviewState ;
29- import com .here .naksha .lib .core .models .geojson .implementation .namespaces .HereDeltaNs ;
30- import com .here .naksha .lib .core .models .geojson .implementation .namespaces .HereMetaNs ;
31- import com .here .naksha .lib .core .util .json .JsonEnum ;
3225import java .util .Map ;
26+ import naksha .model .mom .MomDeltaNs ;
27+ import naksha .model .mom .MomMetaNs ;
28+ import naksha .model .objects .NakshaFeature ;
29+ import naksha .model .objects .NakshaProperties ;
3330import org .jetbrains .annotations .NotNull ;
3431import org .jetbrains .annotations .Nullable ;
3532
3633public class Mom10Transformation {
3734
38- private Mom10Transformation () {}
35+ private Mom10Transformation () {
36+ }
3937
40- public static void populatePreMom10Namespaces (@ Nullable XyzFeature feature ) {
38+ public static void populatePreMom10Namespaces (@ Nullable NakshaFeature feature ) {
4139 if (feature == null ) {
4240 return ;
4341 }
4442
45- XyzProperties properties = feature .getProperties ();
43+ NakshaProperties properties = feature .getProperties ();
4644 Map <String , Object > meta = (Map <String , Object >) properties .get (META );
4745 if (meta != null && !meta .isEmpty ()) {
48- HereDeltaNs deltaNs = deltaNs (meta );
49- properties .setDeltaNamespace (deltaNs );
50- HereMetaNs metaNs = metaNs (meta );
51- properties .setMetaNamespace (metaNs );
46+ MomDeltaNs deltaNs = deltaNs (meta );
47+ properties .setDelta (deltaNs );
48+ MomMetaNs metaNs = metaNs (meta );
49+ properties .setMeta (metaNs );
5250 }
5351 }
5452
55- private static @ NotNull HereMetaNs metaNs (@ NotNull Map <String , Object > meta ) {
56- HereMetaNs metaNs = new HereMetaNs ();
53+ private static @ NotNull MomMetaNs metaNs (@ NotNull Map <String , Object > meta ) {
54+ MomMetaNs metaNs = new MomMetaNs ();
5755 for (String metaKey : COMMON_META_PROPERTIES ) {
5856 Object value = meta .get (metaKey );
5957 if (value != null ) {
@@ -63,19 +61,19 @@ public static void populatePreMom10Namespaces(@Nullable XyzFeature feature) {
6361 return metaNs ;
6462 }
6563
66- private static @ Nullable HereDeltaNs deltaNs (@ NotNull Map <String , Object > meta ) {
64+ private static @ Nullable MomDeltaNs deltaNs (@ NotNull Map <String , Object > meta ) {
6765 Map <String , Object > moderationInfo = (Map <String , Object >) meta .get (MODERATION_INFO );
6866 if (moderationInfo == null ) {
6967 return null ;
7068 } else {
71- HereDeltaNs deltaNs = new HereDeltaNs ();
72- String rawChangeState = (String ) moderationInfo .get (DeltaProperties .CHANGE_STATE );
73- if (rawChangeState != null ) {
74- deltaNs .setChangeState (JsonEnum . get ( EChangeState . class , rawChangeState ) );
69+ MomDeltaNs deltaNs = new MomDeltaNs ();
70+ String changeState = (String ) moderationInfo .get (DeltaProperties .CHANGE_STATE );
71+ if (changeState != null ) {
72+ deltaNs .setChangeState (changeState );
7573 }
76- String rawReviewState = (String ) moderationInfo .get (DeltaProperties .REVIEW_STATE );
77- if (rawChangeState != null ) {
78- deltaNs .setReviewState (JsonEnum . get ( EReviewState . class , rawReviewState ) );
74+ String reviewState = (String ) moderationInfo .get (DeltaProperties .REVIEW_STATE );
75+ if (reviewState != null ) {
76+ deltaNs .setReviewState (reviewState );
7977 }
8078 String originId = (String ) moderationInfo .get (DeltaProperties .ORIGIN_ID );
8179 if (originId != null ) {
@@ -89,9 +87,9 @@ public static void populatePreMom10Namespaces(@Nullable XyzFeature feature) {
8987 }
9088 }
9189
92- public static void dropPreMom10Namespaces (@ Nullable XyzFeature feature ) {
93- XyzProperties properties = feature .getProperties ();
94- properties .remove (XyzProperties . HERE_META_NS );
95- properties .remove (XyzProperties . HERE_DELTA_NS );
90+ public static void dropPreMom10Namespaces (@ Nullable NakshaFeature feature ) {
91+ NakshaProperties properties = feature .getProperties ();
92+ properties .remove (NakshaProperties . META_KEY );
93+ properties .remove (NakshaProperties . DELTA_KEY );
9694 }
9795}
0 commit comments