src/main/java/application/rest/v1/KAppNavEndpoint.java
// Resolves the ${status} operator, replacing it with the given simple status value.
Resolves the ${status} operator, replacing it with the given simple status value.
Resolves the $ { status } operator replacing it with the given simple status value .
protected static JsonObject resolveStatusOperator(JsonObject statusObj, String simpleStatus) {
        final JsonElement valueObj = statusObj.get(VALUE_PROPERTY_NAME);
        if (valueObj != null && valueObj.isJsonPrimitive()) {
            String value = valueObj.getAsString();
            boolean changed = false;
            JsonElement flyoverObj = statusObj.get(FLYOVER_PROPERTY_NAME);
            if (flyoverObj != null && flyoverObj.isJsonPrimitive()) {
                String flyover = flyoverObj.getAsString();
                if (flyover.contains(STATUS_OPERATOR)) {
                    flyover = flyover.replace(STATUS_OPERATOR, simpleStatus);
                    flyoverObj = new JsonPrimitive(flyover);
                    changed = true;
                }
            }
            nls.
            JsonElement flyoverNLSObj = statusObj.get(FLYOVER_NLS_PROPERTY_NAME);
            if (flyoverNLSObj != null) {
                if (flyoverNLSObj.isJsonPrimitive()) {
                    String flyoverNLS = flyoverNLSObj.getAsString();
                    if (flyoverNLS.contains(STATUS_OPERATOR)) {
                        flyoverNLS = flyoverNLS.replace(STATUS_OPERATOR, simpleStatus);
                        flyoverNLSObj = new JsonPrimitive(flyoverNLS);
                        changed = true;
                    }
                }
                else if (flyoverNLSObj.isJsonArray()) {
                    final JsonArray array = flyoverNLSObj.getAsJsonArray();
                    final JsonArray result = new JsonArray();
                    final AtomicBoolean changedArray = new AtomicBoolean(false);
                    array.forEach(e -> {
                        if (e != null && e.isJsonPrimitive()) {
                            String flyoverNLS = e.getAsString();
                            if (flyoverNLS.contains(STATUS_OPERATOR)) {
                                flyoverNLS = flyoverNLS.replace(STATUS_OPERATOR, simpleStatus);
                                e = new JsonPrimitive(flyoverNLS);
                                changedArray.set(true);
                            }
                        }
                        result.add(e);
                    });
                    if (changedArray.get()) {
                        flyoverNLSObj = result;
                        changed = true;
                    }
                }
            }
            if (changed) {
                return createStatusObject(statusObj, value, flyoverObj, flyoverNLSObj);
            }
        }
        return statusObj;
    }
protected static JsonObject resolveStatusOperator ( JsonObject statusObj , String simpleStatus ) { final JsonElement valueObj = statusObj . get ( VALUE_PROPERTY_NAME ) ; if ( valueObj != null && valueObj . isJsonPrimitive ( ) ) { String value = valueObj . getAsString ( ) ; boolean changed = false ; JsonElement flyoverObj = statusObj . get ( FLYOVER_PROPERTY_NAME ) ; if ( flyoverObj != null && flyoverObj . isJsonPrimitive ( ) ) { String flyover = flyoverObj . getAsString ( ) ; if ( flyover . contains ( STATUS_OPERATOR ) ) { flyover = flyover . replace ( STATUS_OPERATOR , simpleStatus ) ; flyoverObj = new JsonPrimitive ( flyover ) ; changed = true ; } } JsonElement flyoverNLSObj = statusObj . get ( FLYOVER_NLS_PROPERTY_NAME ) ; if ( flyoverNLSObj != null ) { if ( flyoverNLSObj . isJsonPrimitive ( ) ) { String flyoverNLS = flyoverNLSObj . getAsString ( ) ; if ( flyoverNLS . contains ( STATUS_OPERATOR ) ) { flyoverNLS = flyoverNLS . replace ( STATUS_OPERATOR , simpleStatus ) ; flyoverNLSObj = new JsonPrimitive ( flyoverNLS ) ; changed = true ; } } else if ( flyoverNLSObj . isJsonArray ( ) ) { final JsonArray array = flyoverNLSObj . getAsJsonArray ( ) ; final JsonArray result = new JsonArray ( ) ; final AtomicBoolean changedArray = new AtomicBoolean ( false ) ; array . forEach ( e -> { if ( e != null && e . isJsonPrimitive ( ) ) { String flyoverNLS = e . getAsString ( ) ; if ( flyoverNLS . contains ( STATUS_OPERATOR ) ) { flyoverNLS = flyoverNLS . replace ( STATUS_OPERATOR , simpleStatus ) ; e = new JsonPrimitive ( flyoverNLS ) ; changedArray . set ( true ) ; } } result . add ( e ) ; } ) ; if ( changedArray . get ( ) ) { flyoverNLSObj = result ; changed = true ; } } } if ( changed ) { return createStatusObject ( statusObj , value , flyoverObj , flyoverNLSObj ) ; } } return statusObj ; }
Resolves the ${status} operator, replacing it with the given simple status value.
Resolves the $ { status } operator replacing it with the given simple status value .
// process flyover. // process flyover.nls. // The object passed to this method must not be mutated so create a new one.