Class ModuleDescriptors.HashCodeBuilder

java.lang.Object
com.atlassian.jira.plugin.util.ModuleDescriptors.HashCodeBuilder
Enclosing class:
ModuleDescriptors

@Immutable public static class ModuleDescriptors.HashCodeBuilder extends Object
Assists in implementing Object.hashCode() methods for module descriptors based on the hashCode of the descriptor's complete key.
  • Constructor Summary

    Constructors
    Constructor
    Description
    HashCodeBuilder(com.atlassian.plugin.ModuleDescriptor descriptor)
    Creates an instance of the HashCodeBuilder for a module descriptor.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The computed hashCode from toHashCode() is returned due to the likelyhood of bugs in mis-calling toHashCode() and the unlikelyness of it mattering what the hashCode for HashCodeBuilder itself is.
    int
    Return the computed hashCode for this module descriptor.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HashCodeBuilder

      public HashCodeBuilder(com.atlassian.plugin.ModuleDescriptor descriptor)
      Creates an instance of the HashCodeBuilder for a module descriptor. Must not be null.
      Parameters:
      descriptor - the module descriptor to create a hashCode implementation for.
  • Method Details

    • toHashCode

      public int toHashCode()
      Return the computed hashCode for this module descriptor.
      Returns:
      hashCode based on the hashCode of the descriptor's complete key.
    • hashCode

      public int hashCode()
      The computed hashCode from toHashCode() is returned due to the likelyhood of bugs in mis-calling toHashCode() and the unlikelyness of it mattering what the hashCode for HashCodeBuilder itself is.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode based on the complete key of the module descriptor.