class DateAppIdHashFunction implements HashFunction {

    @Override
    public int indexOf(Object key) {
        String hashKey = String.valueOf(key);
        Matcher matcher = pattern.matcher(hashKey);
        if (matcher.matches()) {
            YearMonth yearMonth = YearMonth.parse(hashKey, yearMonthFormatter);
            return yearMonth.getYear() * 100 + yearMonth.getMonthValue();
        }
        int appIdValue = partitions != 0 ? Math.abs(hashKey.hashCode()) % partitions : 0;
        return appIdValue;
    }

    public  DateAppIdHashFunction();
    public  DateAppIdHashFunction(int partitions);

}