class DecimalUtil {

  public static int precision(final Schema schema) {
    requireDecimal(schema);
    final String precisionString = schema.parameters().get(PRECISION_FIELD);
    if (precisionString == null) {
      throw new KsqlException("Invalid Decimal schema: precision parameter not found.");
    }

    try {
      return Integer.parseInt(precisionString);
    } catch (final NumberFormatException e) {
      throw new KsqlException("Invalid precision parameter found in Decimal schema: ", e);
    }
  }

  private  DecimalUtil();

}