Class NormalizerSerializer


  • public class NormalizerSerializer
    extends Object
    • Constructor Detail

      • NormalizerSerializer

        public NormalizerSerializer()
    • Method Detail

      • write

        public void write​(@NonNull
                          @NonNull Normalizer normalizer,
                          @NonNull
                          @NonNull File file)
                   throws IOException
        Serialize a normalizer to the given file
        Parameters:
        normalizer - the normalizer
        file - the destination file
        Throws:
        IOException
      • write

        public void write​(@NonNull
                          @NonNull Normalizer normalizer,
                          @NonNull
                          @NonNull String path)
                   throws IOException
        Serialize a normalizer to the given file path
        Parameters:
        normalizer - the normalizer
        path - the destination file path
        Throws:
        IOException
      • write

        public void write​(@NonNull
                          @NonNull Normalizer normalizer,
                          @NonNull
                          @NonNull OutputStream stream)
                   throws IOException
        Serialize a normalizer to an output stream
        Parameters:
        normalizer - the normalizer
        stream - the output stream to write to
        Throws:
        IOException
      • restore

        public <T extends Normalizer> T restore​(@NonNull
                                                @NonNull String path)
                                         throws Exception
        Restore a normalizer from the given path
        Parameters:
        path - path of the file containing a serialized normalizer
        Returns:
        the restored normalizer
        Throws:
        IOException
        Exception
      • restore

        public <T extends Normalizer> T restore​(@NonNull
                                                @NonNull File file)
                                         throws Exception
        Restore a normalizer from the given file
        Parameters:
        file - the file containing a serialized normalizer
        Returns:
        the restored normalizer
        Throws:
        IOException
        Exception
      • restore

        public <T extends Normalizer> T restore​(@NonNull
                                                @NonNull InputStream stream)
                                         throws Exception
        Restore a normalizer from an input stream
        Parameters:
        stream - a stream of serialized normalizer data
        Returns:
        the restored normalizer
        Throws:
        IOException
        Exception
      • getDefault

        public static NormalizerSerializer getDefault()
        Get the default serializer configured with strategies for the built-in normalizer implementations
        Returns:
        the default serializer