public static Optional<PowerTag> get(final Taggable taggable) { return Validators.from(PowerTag.class, taggable); } }
public static Optional<SportTag> get(final Taggable taggable) { return Validators.from(SportTag.class, taggable); } }
public static Optional<NaturalTag> get(final Taggable taggable) { return Validators.from(NaturalTag.class, taggable); } }
public static Optional<NoExitTag> get(final Taggable taggable) { return Validators.from(NoExitTag.class, taggable); } }
public static Optional<LeisureTag> get(final Taggable taggable) { return Validators.from(LeisureTag.class, taggable); } }
public static Optional<OneWayTag> tag(final Taggable taggable) { return Validators.from(OneWayTag.class, taggable); } }
public static boolean isNoName(final Taggable taggable) { final Optional<NoNameTag> noName = Validators.from(NoNameTag.class, taggable); return noName.isPresent() && YES == noName.get(); } }
public static boolean isBuilding(final Taggable taggable) { final Optional<BuildingTag> building = Validators.from(BuildingTag.class, taggable); return building.isPresent() && VALID_BUILDINGS.contains(building.get()); } }
public static boolean isSyntheticBoundaryNode(final Taggable taggable) { final Optional<SyntheticBoundaryNodeTag> boundary = Validators .from(SyntheticBoundaryNodeTag.class, taggable); return boundary.isPresent() && SYNTHETIC_BOUNDARY_NODES.contains(boundary.get()); } }
public static boolean isTunnel(final Taggable taggable) { final Optional<TunnelTag> tunnel = Validators.from(TunnelTag.class, taggable); return tunnel.isPresent() && TUNNEL_WAYS.contains(tunnel.get()); } }
public static boolean isOnlyPathRestriction(final Taggable taggable) { final Optional<TurnRestrictionTag> turnRestriction = Validators .from(TurnRestrictionTag.class, taggable); return turnRestriction.isPresent() && ONLY_PATH_RESTRICTIONS.contains(turnRestriction.get()); }
public static boolean isBoundaryNode(final Taggable taggable) { final Optional<SyntheticBoundaryNodeTag> boundary = Validators .from(SyntheticBoundaryNodeTag.class, taggable); return boundary.isPresent() && ALL_BOUNDARY_NODES.contains(boundary.get()); }
public static boolean isPrivate(final Taggable taggable) { final Optional<FootTag> foot = Validators.from(FootTag.class, taggable); return foot.isPresent() && PRIVATE_ACCESS.contains(foot.get()); } }
public static boolean isNoPathRestriction(final Taggable taggable) { final Optional<TurnRestrictionTag> turnRestriction = Validators .from(TurnRestrictionTag.class, taggable); return turnRestriction.isPresent() && NO_PATH_RESTRICTIONS.contains(turnRestriction.get()); }
public static boolean isExistingBoundaryNode(final Taggable taggable) { final Optional<SyntheticBoundaryNodeTag> boundary = Validators .from(SyntheticBoundaryNodeTag.class, taggable); return boundary.isPresent() && EXISTING_BOUNDARY_NODES.contains(boundary.get()); }
public static boolean isPedestrianAccessible(final Taggable taggable) { final Optional<FootTag> foot = Validators.from(FootTag.class, taggable); return foot.isPresent() && PEDESTRIAN_ACCESS.contains(foot.get()); }
@Test public void testMissingValue() { final TestTaggable testing = new TestTaggable(BuildingTag.KEY, "Nope"); final Optional<EightBall> found = Validators.from(EightBall.class, testing); Assert.assertFalse(found.isPresent()); }
@Test public void stringToEnum() { Assert.assertEquals(Optional.of(ParkingTag.MULTI_STOREY), Validators.from(ParkingTag.class, new TestTaggable(ParkingTag.KEY, "multi-storey"))); } }
@Test public void testExists() { final TestTaggable testing = new TestTaggable(EightBall.KEY, "maYbE"); final Optional<EightBall> found = Validators.from(EightBall.class, testing); Assert.assertTrue(found.isPresent()); Assert.assertEquals(EightBall.MAYBE, found.get()); }
@Test public void testWith() { final TestTaggable testing = new TestTaggable(DisusedEightBall.KEY, "maYbE"); final Optional<EightBall> found = Validators.from(DisusedEightBall.class, EightBall.class, testing); Assert.assertTrue(found.isPresent()); Assert.assertEquals(EightBall.MAYBE, found.get()); }