Class ModuleInfoHash.Builder

java.lang.Object
com.netflix.module.ModuleInfoHash.Builder
Enclosing class:
ModuleInfoHash

public static final class ModuleInfoHash.Builder extends Object
Builds immutable detached module hash sets.
  • Method Details

    • put

      public ModuleInfoHash.Builder put(String name, ModuleHash hash)
      Records a hash by unversioned module name.
      Parameters:
      name - the module name
      hash - the content hash
      Returns:
      this builder
    • put

      public ModuleInfoHash.Builder put(String name, String version, ModuleHash hash)
      Records a hash by module name and descriptor version.
      Parameters:
      name - the module name
      version - the module version
      hash - the content hash
      Returns:
      this builder
    • put

      Records a hash by coordinate.
      Parameters:
      coordinate - the module coordinate
      hash - the content hash
      Returns:
      this builder
    • computeAndPut

      public ModuleInfoHash.Builder computeAndPut(ModuleReference reference) throws IOException
      Computes and records the hash of a module using the coordinate reported by its descriptor.
      Parameters:
      reference - the resolved module
      Returns:
      this builder
      Throws:
      IOException - if the module cannot be read
    • build

      public ModuleInfoHash build()
      Creates an immutable snapshot of the recorded entries.
      Returns:
      the module hash set