class EtiqetHandlers {

    public void checkTimeStampPrecision(String field, String messageName, String precision) {
        if (StringUtils.isNullOrEmpty(precision)) {
            fail("Level of time precision must be provided e.g 0,3,6,9,second,milli,micro or nano");
        }

        int timePrecision = -1;
        try {
            timePrecision = Integer.parseInt(precision);
        } catch (NumberFormatException e) {
            switch (precision.toLowerCase()) {
                case SECONDS_NAME:
                    timePrecision = SECONDS_TIME_VALUE;
                    break;
                case MILLI_TIME_NAME:
                    timePrecision = MILLI_TIME_VALUE;
                    break;
                case MICRO_TIME_NAME:
                    timePrecision = MICRO_TIME_VALUE;
                    break;
                case NANO_TIME_NAME:
                    timePrecision = NANO_TIME_VALUE;
                    break;
                default:
                    fail("Level of time precision must be provided e.g 0,3,6,9,second,milli,micro or nano");
            }
        }

        Cdr response = getResponse(messageName);
        assertNotNull(String.format("Couldn't find message: %s", messageName), response);
        checkPrecision(timePrecision, response.getItem(field).toString());
    }

    public  EtiqetHandlers();

}