@Test public void testGetSegments() { AtlasPath path = new AtlasPath("/orders"); assertNotNull(path.getSegments(true)); List<SegmentContext> segmentContexts = path.getSegments(true); assertNotNull(segmentContexts); assertEquals(2, segmentContexts.size()); SegmentContext sc = segmentContexts.get(1); assertEquals("orders", sc.getName()); assertNull(sc.getCollectionIndex()); assertEquals("orders", sc.getExpression()); assertNotNull(sc.toString()); }
public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyList(); }
AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyList(); } }
AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyList(); } AtlasPath(String p); protected  AtlasPath(List<SegmentContext> segments); private  AtlasPath(); }
AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyList(); } AtlasPath(String p); protected  AtlasPath(List<SegmentContext> segments); private  AtlasPath(); static Field extractChildren(Field f, String path); static void setCollectionIndexRecursively(FieldGroup group, int segmentIndex, int index); AtlasPath appendField(String fieldExpression); List<SegmentContext> getSegments(boolean includeRoot); Boolean isRoot(); SegmentContext getRootSegment(); Boolean isCollectionRoot(); Boolean hasCollectionRoot(); SegmentContext getLastSegment(); SegmentContext getLastCollectionSegment(); SegmentContext getLastSegmentParent(); AtlasPath getLastSegmentParentPath(); SegmentContext getParentSegmentOf(SegmentContext sc); boolean hasCollection(); boolean isIndexedCollection(); SegmentContext setCollectionIndex(int segmentIndex, Integer collectionIndex); List<SegmentContext> getCollectionSegments(boolean includeRoot); SegmentContext setVacantCollectionIndex(Integer collectionIndex); String getSegmentPath(SegmentContext sc); @Override String toString(); String getOriginalPath(); int getCollectionSegmentCount(); }
AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyList(); } AtlasPath(String p); protected  AtlasPath(List<SegmentContext> segments); private  AtlasPath(); static Field extractChildren(Field f, String path); static void setCollectionIndexRecursively(FieldGroup group, int segmentIndex, int index); AtlasPath appendField(String fieldExpression); List<SegmentContext> getSegments(boolean includeRoot); Boolean isRoot(); SegmentContext getRootSegment(); Boolean isCollectionRoot(); Boolean hasCollectionRoot(); SegmentContext getLastSegment(); SegmentContext getLastCollectionSegment(); SegmentContext getLastSegmentParent(); AtlasPath getLastSegmentParentPath(); SegmentContext getParentSegmentOf(SegmentContext sc); boolean hasCollection(); boolean isIndexedCollection(); SegmentContext setCollectionIndex(int segmentIndex, Integer collectionIndex); List<SegmentContext> getCollectionSegments(boolean includeRoot); SegmentContext setVacantCollectionIndex(Integer collectionIndex); String getSegmentPath(SegmentContext sc); @Override String toString(); String getOriginalPath(); int getCollectionSegmentCount(); static final String PATH_SEPARATOR; static final char PATH_SEPARATOR_CHAR; static final String PATH_SEPARATOR_ESCAPED; static final String PATH_ARRAY_START; static final String PATH_ARRAY_END; static final String PATH_LIST_START; static final String PATH_LIST_END; static final String PATH_MAP_START; static final String PATH_MAP_END; static final String PATH_ATTRIBUTE_PREFIX; static final String PATH_NAMESPACE_SEPARATOR; }