class KMeansUtil implements Serializable {

    public static int[] getKmeansPredictColIdxs(KMeansTrainModelData.ParamSummary params, String[] dataCols) {
        Preconditions.checkArgument((null == params.longtitudeColName) == (null == params.latitudeColName),
            "Model Format error!");
        Preconditions.checkArgument(params.distanceType.equals(HasKMeansWithHaversineDistanceType.DistanceType.HAVERSINE) == (null == params.vectorColName
                && null != params.longtitudeColName),
            "Model Format error!");
        int[] colIdxs;
        if (null != params.vectorColName) {
            colIdxs = new int[1];
            colIdxs[0] = TableUtil.findColIndexWithAssert(dataCols, params.vectorColName);
        } else {
            colIdxs = new int[2];
            colIdxs[0] = TableUtil.findColIndexWithAssert(dataCols, params.latitudeColName);
            colIdxs[1] = TableUtil.findColIndexWithAssert(dataCols, params.longtitudeColName);
        }
        return colIdxs;
    }

}