/** * Replaces type with mapped type for current path. */ protected Class replaceWithMappedTypeForPath(final Class target) { if (mappings == null) { return target; } Class newType; // first try alt paths Path altPath = path.getAltPath(); if (altPath != null) { if (!altPath.equals(path)) { newType = mappings.get(altPath); if (newType != null) { return newType; } } } // now check regular paths newType = mappings.get(path); if (newType != null) { return newType; } return target; }
assertTrue(Path.parse("one.two.three.four").equals(path)); assertEquals(Path.parse("one.two.three.four").hashCode(), path.hashCode()); assertFalse(Path.parse("one.two.three.four").equals(path)); assertNotEquals(Path.parse("one.two.three.four").hashCode(), path.hashCode()); assertFalse(Path.parse("one.two.thre").equals(path)); assertNotEquals(Path.parse("one.two.thre").hashCode(), path.hashCode());