public static <ParametersT extends Parameters, SerializationT extends Serialization>
      ParametersSerializer<ParametersT, SerializationT> create(
          ParametersSerializationFunction<ParametersT, SerializationT> function,
          Class<ParametersT> parametersClass,
          Class<SerializationT> serializationClass) {
    return new ParametersSerializer<ParametersT, SerializationT>(
        parametersClass, serializationClass) {
      @Override
      public SerializationT serializeParameters(ParametersT parameters)
          throws GeneralSecurityException {
        return function.serializeParameters(parameters);
      }
    };
  }
Creates a ParametersSerializer object.

<p>In order to create a ParametersSerializer object, one typically writes a function

<pre>{@code
class MyClass {
  private static MySerialization serializeParameters(MyParameters Parameters)
            throws GeneralSecurityException {
    ...
  }
}
}</pre>

This function can then be used to create a {@code ParametersSerializer}:

<pre>{@code
ParametersSerializer<MyParameters, MySerialization> serializer =
      ParametersSerializer.create(MyClass::serializeParameters, MyParameters.class,
                                 MySerialization.class);
}</pre>
java_src/src/main/java/com/google/crypto/tink/internal/ParametersSerializer.java