DbSetId { public int getDepth() { return getMaxLevel() - getLevel(); } private  DbSetId(@NonNull String[] dimValues, @NonNull String[] dimColumns); @NonNull static DbSetId root(@NonNull String... dimColumns); int getLevel(); @NonNull String getValue(int index); int getMaxLevel(); @NonNull String getColumn(int index); int getDepth(); boolean isSeries(); @NonNull DbSetId child(@NonNull String... dimValues); boolean isRoot(); @NonNull Optional<DbSetId> parent(); @NonNull String[] selectColumns(); @NonNull String[] filterColumns(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); static final IConstraint<DbSetId> SERIES_CONSTRAINT; static final IConstraint<DbSetId> COLLECTION_CONSTRAINT; }
@Test public void testGetDepth() { assertEquals(COLUMNS.length - 0, ID0.getDepth()); assertEquals(COLUMNS.length - 1, ID1.getDepth()); assertEquals(COLUMNS.length - 2, ID2.getDepth()); }