/** * Gets the visibility of the placemark if it is specified. A visibility value of "1" * corresponds as "true", a visibility value of "0" corresponds as false. If the * visibility is not set, the method returns "true". * * @param feature Feature to obtain visibility from. * @return False if a Feature has a visibility value of "1", true otherwise. */ protected static boolean getPlacemarkVisibility(Feature feature) { boolean isFeatureVisible = true; if (feature.hasProperty("visibility")) { String placemarkVisibility = feature.getProperty("visibility"); if (Integer.parseInt(placemarkVisibility) == 0) { isFeatureVisible = false; } } return isFeatureVisible; }
public void testProperty() throws Exception { HashMap<String, String> properties = new HashMap<>(); properties.put("Color", "Red"); properties.put("Width", "3"); feature = new Feature(null, null, properties); assertFalse(feature.hasProperty("llama")); assertTrue(feature.hasProperty("Color")); assertEquals("Red", feature.getProperty("Color")); assertTrue(feature.hasProperty("Width")); assertEquals("3", feature.getProperty("Width")); assertNull(feature.removeProperty("banana")); assertEquals("3", feature.removeProperty("Width")); assertNull(feature.setProperty("Width", "10")); assertEquals("10", feature.setProperty("Width", "500")); }