Merge branch 'stable-2.15'
* stable-2.15: SetPreferences: Trim input for my menus SetPreferences: Reject invalid my menu items GeneralPreferencesIT: Assert values for 'my' and 'changeTable' Change-Id: I2a505e4c55f22e4ebdc84ef2da751eb4826d8af4
This commit is contained in:
		@@ -14,6 +14,8 @@
 | 
			
		||||
 | 
			
		||||
package com.google.gerrit.extensions.client;
 | 
			
		||||
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
 | 
			
		||||
public class MenuItem {
 | 
			
		||||
  public final String url;
 | 
			
		||||
  public final String name;
 | 
			
		||||
@@ -39,4 +41,40 @@ public class MenuItem {
 | 
			
		||||
    this.target = target;
 | 
			
		||||
    this.id = id;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @Override
 | 
			
		||||
  public boolean equals(Object obj) {
 | 
			
		||||
    if (obj instanceof MenuItem) {
 | 
			
		||||
      MenuItem o = (MenuItem) obj;
 | 
			
		||||
      return Objects.equals(url, o.url)
 | 
			
		||||
          && Objects.equals(name, o.name)
 | 
			
		||||
          && Objects.equals(target, o.target)
 | 
			
		||||
          && Objects.equals(id, o.id);
 | 
			
		||||
    }
 | 
			
		||||
    return false;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @Override
 | 
			
		||||
  public int hashCode() {
 | 
			
		||||
    return Objects.hash(url, name, target, id);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @Override
 | 
			
		||||
  public String toString() {
 | 
			
		||||
    return new StringBuilder()
 | 
			
		||||
        .append("MenuItem{")
 | 
			
		||||
        .append("url=")
 | 
			
		||||
        .append(url)
 | 
			
		||||
        .append(',')
 | 
			
		||||
        .append("name=")
 | 
			
		||||
        .append(name)
 | 
			
		||||
        .append(',')
 | 
			
		||||
        .append("target=")
 | 
			
		||||
        .append(target)
 | 
			
		||||
        .append(',')
 | 
			
		||||
        .append("id=")
 | 
			
		||||
        .append(id)
 | 
			
		||||
        .append('}')
 | 
			
		||||
        .toString();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user