public int contentHashCode ( Set < PropertyKey > comparableKeys , boolean includeSystemProperties ) { Map < PropertyKey , Object > sortedMap = new TreeMap <> ( new PropertyKeyComparator ( ) ) ; int hashCode = 42 ; sortedMap . putAll ( properties ) ; if ( comparableKeys == null ) { // calculate hash code for all properties in this map for ( Entry < PropertyKey , Object > entry : sortedMap . entrySet ( ) ) { if ( includeSystemProperties || ! entry . getKey ( ) . isUnvalidated ( ) ) { hashCode ^= entry . hashCode ( ) ; } } } else { for ( Entry < PropertyKey , Object > entry : sortedMap . entrySet ( ) ) { PropertyKey key = entry . getKey ( ) ; if ( comparableKeys . contains ( key ) ) { if ( includeSystemProperties || ! key . isUnvalidated ( ) ) { hashCode ^= entry . hashCode ( ) ; } } } } return hashCode ; }
Calculates a hash code for the contents of this PropertyMap .