Line data Source code
1 : // Copyright (C) 2016 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.api.projects; 16 : 17 : import com.google.common.base.MoreObjects; 18 : import java.util.Objects; 19 : 20 : /** See {@link com.google.gerrit.entities.StoredCommentLinkInfo} for field documentation. */ 21 2 : public class CommentLinkInfo { 22 : public String match; 23 : public String link; 24 : public String prefix; 25 : public String suffix; 26 : public String text; 27 : public Boolean enabled; // null means true 28 : 29 : public transient String name; 30 : 31 : @Override 32 : public boolean equals(Object o) { 33 1 : if (o == this) { 34 0 : return true; 35 : } 36 1 : if (o instanceof CommentLinkInfo) { 37 1 : CommentLinkInfo that = (CommentLinkInfo) o; 38 1 : return Objects.equals(this.match, that.match) 39 1 : && Objects.equals(this.link, that.link) 40 1 : && Objects.equals(this.prefix, that.prefix) 41 1 : && Objects.equals(this.suffix, that.suffix) 42 1 : && Objects.equals(this.text, that.text) 43 1 : && Objects.equals(this.enabled, that.enabled); 44 : } 45 0 : return false; 46 : } 47 : 48 : @Override 49 : public int hashCode() { 50 0 : return Objects.hash(match, link, prefix, suffix, text, enabled); 51 : } 52 : 53 : @Override 54 : public String toString() { 55 0 : return MoreObjects.toStringHelper(this) 56 0 : .add("name", name) 57 0 : .add("match", match) 58 0 : .add("link", link) 59 0 : .add("prefix", prefix) 60 0 : .add("suffix", suffix) 61 0 : .add("text", text) 62 0 : .add("enabled", enabled) 63 0 : .toString(); 64 : } 65 : }