WritableFactories (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.io, class: WritableFactories

Package org.apache.hadoop.io

# Class WritableFactories

java.lang.Object
org.apache.hadoop.io.WritableFactories

@Public @Stable public class WritableFactories extends Object
Factories for non-public writables. Defining a factory permits `ObjectWritable` to be able to construct instances of non-public classes.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static WritableFactory`
  `getFactory(Class c)`
  Define a factory for a class.
  `static Writable`
  `newInstance(Class<? extends Writable> c)`
  Create a new instance of a class with a defined factory.
  `static Writable`
  `newInstance(Class<? extends Writable> c, Configuration conf)`
  Create a new instance of a class with a defined factory.
  `static void`
  `setFactory(Class c, WritableFactory factory)`
  Define a factory for a class.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### setFactory

    public static void setFactory(Class c, WritableFactory factory)
    Define a factory for a class.
    Parameters:
      `c` - input c.
      `factory` - input factory.

  - ### getFactory

    public static WritableFactory getFactory(Class c)
    Define a factory for a class.
    Parameters:
      `c` - input c.
    Returns:
      a factory for a class.

  - ### newInstance

    public static Writable newInstance(Class<? extends Writable> c, Configuration conf)
    Create a new instance of a class with a defined factory.
    Parameters:
      `c` - input c.
      `conf` - input configuration.
    Returns:
      a new instance of a class with a defined factory.

  - ### newInstance

    public static Writable newInstance(Class<? extends Writable> c)
    Create a new instance of a class with a defined factory.
    Parameters:
      `c` - input c.
    Returns:
      a new instance of a class with a defined factory.