public int getType()

in src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsValue.java [134:165]


    public int getType() {
        Object value = props.get(propertyName);
        if (value == null) {
            return PropertyType.UNDEFINED;
        }
        Class type = value.getClass();
        if (type.isArray() && Array.getLength(value) > 0) {
            Object firstItem = Array.get(value, 0);
            if (firstItem != null) {
                type = firstItem.getClass();
            }
        }
        if (type == String.class) {
            return PropertyType.STRING;
        }
        if (type == Boolean.class || type == boolean.class) {
            return PropertyType.BOOLEAN;
        }
        if (type == BigDecimal.class) {
            return PropertyType.DECIMAL;
        }
        if (type == Double.class || type == double.class || type == Float.class || type == float.class) {
            return PropertyType.DOUBLE;
        }
        if (Number.class.isAssignableFrom(type)) {
            return PropertyType.LONG;
        }
        if (type == Calendar.class) {
            return PropertyType.DATE;
        }
        return PropertyType.UNDEFINED;
    }