@Override public <T extends Path.Node> T as(Class<T> nodeType) { if ( ( kind == ElementKind.BEAN && nodeType == BeanNode.class ) || ( kind == ElementKind.CONSTRUCTOR && nodeType == ConstructorNode.class ) || ( kind == ElementKind.CROSS_PARAMETER && nodeType == CrossParameterNode.class ) || ( kind == ElementKind.METHOD && nodeType == MethodNode.class ) || ( kind == ElementKind.PARAMETER && nodeType == ParameterNode.class ) || ( kind == ElementKind.PROPERTY && ( nodeType == PropertyNode.class || nodeType == org.hibernate.validator.path.PropertyNode.class ) ) || ( kind == ElementKind.RETURN_VALUE && nodeType == ReturnValueNode.class ) ) { return nodeType.cast( this ); } throw log.getUnableToNarrowNodeTypeException( this.getClass(), kind, nodeType ); }
@Override public <T extends Path.Node> T as(Class<T> nodeType) { if ( ( kind == ElementKind.BEAN && nodeType == BeanNode.class ) || ( kind == ElementKind.CONSTRUCTOR && nodeType == ConstructorNode.class ) || ( kind == ElementKind.CROSS_PARAMETER && nodeType == CrossParameterNode.class ) || ( kind == ElementKind.METHOD && nodeType == MethodNode.class ) || ( kind == ElementKind.PARAMETER && nodeType == ParameterNode.class ) || ( kind == ElementKind.PROPERTY && ( nodeType == PropertyNode.class || nodeType == org.hibernate.validator.path.PropertyNode.class ) ) || ( kind == ElementKind.RETURN_VALUE && nodeType == ReturnValueNode.class ) || ( kind == ElementKind.CONTAINER_ELEMENT && ( nodeType == ContainerElementNode.class || nodeType == org.hibernate.validator.path.ContainerElementNode.class ) ) ) { return nodeType.cast( this ); } throw LOG.getUnableToNarrowNodeTypeException( this.getClass(), kind, nodeType ); }