class ReinterpretConversion {

  public BeamSqlPrimitive convert(BeamSqlPrimitive input) {
    if (!from.contains(input.getOutputType())) {
      throw new IllegalArgumentException(
          "Unable to convert from "
              + input.getOutputType().name()
              + " to "
              + to.name()
              + ". This conversion only supports "
              + toString());
    }

    return convertFunction.apply(input);
  }

  private  ReinterpretConversion(Builder builder);

}