code: public static Optional<Integer> getPropertyType(final Node node, final String propertyName)
              throws RepositoryException {
          LOGGER.debug("Getting type of property: {} from node: {}", propertyName, node);
          return getDefinitionForPropertyName(node, propertyName).map(PropertyDefinition::getRequiredType);
      }
docs: Get the JCR property type ID for a given property name. If unsure, mark
  it as UNDEFINED.
  
  @param node the JCR node to add the property on
  @param propertyName the property name
  @return a PropertyType value
  @throws RepositoryException if repository exception occurred