Code example for SimpleDateFormat

Methods: format

0
	public boolean equals(Object obj) {
		if ( !( obj instanceof UserPK ) ) {
			return false; 
		} 
		UserPK userPK = (UserPK) obj;
		SimpleDateFormat formatter = new SimpleDateFormat( "MM/dd/yyyy" );
		return userKey.equals( userPK.userKey ) && formatter.format( startDate )
				.equals( formatter.format( userPK.startDate ) )
				&& formatter.format( endDate ).equals( formatter.format( userPK.endDate ) );
	} 
 
	@Override 
	public int hashCode() { 
		return userKey.hashCode() * startDate.hashCode() * endDate.hashCode();
	} 
} 
Contextual code suggestions in your IDE  Get Codota for Java