Line data Source code
1 : // Copyright (C) 2014 The Android Open Source Project 2 : // 3 : // Licensed under the Apache License, Version 2.0 (the "License"); 4 : // you may not use this file except in compliance with the License. 5 : // You may obtain a copy of the License at 6 : // 7 : // http://www.apache.org/licenses/LICENSE-2.0 8 : // 9 : // Unless required by applicable law or agreed to in writing, software 10 : // distributed under the License is distributed on an "AS IS" BASIS, 11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 : // See the License for the specific language governing permissions and 13 : // limitations under the License. 14 : 15 : package com.google.gerrit.extensions.common; 16 : 17 : import com.google.gerrit.extensions.webui.WebLink.Target; 18 : import java.util.Objects; 19 : 20 : public class WebLinkInfo { 21 : public String name; 22 : public String imageUrl; 23 : public String url; 24 : public String target; 25 : 26 4 : public WebLinkInfo(String name, String imageUrl, String url, String target) { 27 4 : this.name = name; 28 4 : this.imageUrl = imageUrl; 29 4 : this.url = url; 30 4 : this.target = target; 31 4 : } 32 : 33 : public WebLinkInfo(String name, String imageUrl, String url) { 34 4 : this(name, imageUrl, url, Target.SELF); 35 4 : } 36 : 37 : @Override 38 : public boolean equals(Object o) { 39 0 : if (!(o instanceof WebLinkInfo)) { 40 0 : return false; 41 : } 42 0 : WebLinkInfo i = (WebLinkInfo) o; 43 0 : return Objects.equals(name, i.name) 44 0 : && Objects.equals(imageUrl, i.imageUrl) 45 0 : && Objects.equals(url, i.url) 46 0 : && Objects.equals(target, i.target); 47 : } 48 : 49 : @Override 50 : public int hashCode() { 51 0 : return Objects.hash(name, imageUrl, url, target); 52 : } 53 : 54 : @Override 55 : public String toString() { 56 0 : return getClass().getSimpleName() 57 : + "{name=" 58 : + name 59 : + ", imageUrl=" 60 : + imageUrl 61 : + ", url=" 62 : + url 63 : + ", target" 64 : + target 65 : + "}"; 66 : } 67 : 68 0 : protected WebLinkInfo() {} 69 : }