X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cps-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fcps%2Fspi%2FFetchDescendantsOption.java;h=76d9bba7e54bc248c658b2aa0f4895e31cda5918;hb=8126f03d255341973112daaec2efaf90e3a40832;hp=02574995dcd3d896effa95aedaff58225366ad1b;hpb=16e9ea97a6a46f3e59cf600a528953c9c0e8e48c;p=cps.git diff --git a/cps-service/src/main/java/org/onap/cps/spi/FetchDescendantsOption.java b/cps-service/src/main/java/org/onap/cps/spi/FetchDescendantsOption.java index 02574995d..76d9bba7e 100644 --- a/cps-service/src/main/java/org/onap/cps/spi/FetchDescendantsOption.java +++ b/cps-service/src/main/java/org/onap/cps/spi/FetchDescendantsOption.java @@ -30,8 +30,8 @@ import org.onap.cps.spi.exceptions.DataValidationException; @RequiredArgsConstructor public class FetchDescendantsOption { - public static final FetchDescendantsOption DIRECT_CHILDREN_ONLY - = new FetchDescendantsOption(1, "DirectChildrenOnly"); + public static final FetchDescendantsOption DIRECT_CHILD_ONLY + = new FetchDescendantsOption(1, "DirectChildOnly"); public static final FetchDescendantsOption OMIT_DESCENDANTS = new FetchDescendantsOption(0, "OmitDescendants"); public static final FetchDescendantsOption INCLUDE_ALL_DESCENDANTS @@ -42,7 +42,7 @@ public class FetchDescendantsOption { } private static final Pattern FETCH_DESCENDANTS_OPTION_PATTERN = - Pattern.compile("^$|^all$|^none$|^[0-9]+$|^-1$"); + Pattern.compile("^$|^all$|^none$|^direct$|^[0-9]+$|^-1$|^1$"); private final int depth; @@ -96,6 +96,8 @@ public class FetchDescendantsOption { return FetchDescendantsOption.OMIT_DESCENDANTS; } else if ("-1".equals(fetchDescendantsOptionAsString) || "all".equals(fetchDescendantsOptionAsString)) { return FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS; + } else if ("1".equals(fetchDescendantsOptionAsString) || "direct".equals(fetchDescendantsOptionAsString)) { + return FetchDescendantsOption.DIRECT_CHILD_ONLY; } else { final Integer depth = Integer.valueOf(fetchDescendantsOptionAsString); return new FetchDescendantsOption(depth);