@Immutable public static class

ModuleDescriptors.HashCodeBuilder

extends Object
java.lang.Object
   ↳ com.atlassian.jira.plugin.util.ModuleDescriptors.HashCodeBuilder

Class Overview

Assists in implementing hashCode() methods for module descriptors based on the hashCode of the descriptor's complete key.

Summary

Public Constructors
HashCodeBuilder(ModuleDescriptor descriptor)
Creates an instance of the HashCodeBuilder for a module descriptor.
Public Methods
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.
int toHashCode()
Return the computed hashCode for this module descriptor.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public HashCodeBuilder (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.

Public Methods

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.

Returns
  • hashCode based on the complete key of the module descriptor.

public int toHashCode ()

Return the computed hashCode for this module descriptor.

Returns
  • hashCode based on the hashCode of the descriptor's complete key.