@Test public void testIsChildOf() throws Exception { GeographicLevel someLevel = new GeographicLevel(123L, "some level", "some level", 2); GeographicLevel root = new GeographicLevel(123L, "root", "root", 1); assertTrue(someLevel.isLowerInHierarchyThan(root)); assertFalse(root.isLowerInHierarchyThan(someLevel)); assertFalse(root.isLowerInHierarchyThan(root)); assertFalse(someLevel.isLowerInHierarchyThan(someLevel)); }
@JsonIgnore public boolean isLowerInHierarchyThan(GeographicLevel level) { return this.getLevelNumber() > level.getLevelNumber(); }
GeographicLevel extends BaseModel implements Importable { @JsonIgnore public boolean isLowerInHierarchyThan(GeographicLevel level) { return this.getLevelNumber() > level.getLevelNumber(); } }
GeographicLevel extends BaseModel implements Importable { @JsonIgnore public boolean isLowerInHierarchyThan(GeographicLevel level) { return this.getLevelNumber() > level.getLevelNumber(); } GeographicLevel(Long id, String code, String name, Integer levelNumber);  GeographicLevel(Long id); }
GeographicLevel extends BaseModel implements Importable { @JsonIgnore public boolean isLowerInHierarchyThan(GeographicLevel level) { return this.getLevelNumber() > level.getLevelNumber(); } GeographicLevel(Long id, String code, String name, Integer levelNumber);  GeographicLevel(Long id); @JsonIgnore boolean isRootLevel(); @JsonIgnore boolean isLowerInHierarchyThan(GeographicLevel level); }
GeographicLevel extends BaseModel implements Importable { @JsonIgnore public boolean isLowerInHierarchyThan(GeographicLevel level) { return this.getLevelNumber() > level.getLevelNumber(); } GeographicLevel(Long id, String code, String name, Integer levelNumber);  GeographicLevel(Long id); @JsonIgnore boolean isRootLevel(); @JsonIgnore boolean isLowerInHierarchyThan(GeographicLevel level);  }