public static ColumnType from()

in common/src/main/java/org/opensearch/ml/common/dataframe/ColumnType.java [18:48]


    public static ColumnType from(Object object) {
        if(object instanceof Short) {
            return SHORT;
        }

        if(object instanceof Integer) {
            return INTEGER;
        }

        if(object instanceof Long) {
            return LONG;
        }

        if(object instanceof String) {
            return STRING;
        }

        if(object instanceof Double) {
            return DOUBLE;
        }

        if(object instanceof Boolean) {
            return BOOLEAN;
        }

        if(object instanceof Float) {
            return FLOAT;
        }

        throw new IllegalArgumentException("unsupported type:" + object.getClass().getName());
    }