001/* 002 * Copyright 2020 Global Biodiversity Information Facility (GBIF) 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.gbif.api.model.collections.suggestions; 017 018import java.io.Serializable; 019import java.util.Date; 020import java.util.Objects; 021 022public class Change implements Serializable { 023 private String field; 024 private Object suggested; 025 private Object previous; 026 private Date created; 027 private String author; 028 private boolean overwritten; 029 private boolean outdated; 030 031 public String getField() { 032 return field; 033 } 034 035 public void setField(String field) { 036 this.field = field; 037 } 038 039 public Object getSuggested() { 040 return suggested; 041 } 042 043 public void setSuggested(Object suggested) { 044 this.suggested = suggested; 045 } 046 047 public Object getPrevious() { 048 return previous; 049 } 050 051 public void setPrevious(Object previous) { 052 this.previous = previous; 053 } 054 055 public Date getCreated() { 056 return created; 057 } 058 059 public void setCreated(Date created) { 060 this.created = created; 061 } 062 063 public String getAuthor() { 064 return author; 065 } 066 067 public void setAuthor(String author) { 068 this.author = author; 069 } 070 071 public boolean isOverwritten() { 072 return overwritten; 073 } 074 075 public void setOverwritten(boolean overwritten) { 076 this.overwritten = overwritten; 077 } 078 079 public boolean isOutdated() { 080 return outdated; 081 } 082 083 public void setOutdated(boolean outdated) { 084 this.outdated = outdated; 085 } 086 087 @Override 088 public boolean equals(Object o) { 089 if (this == o) { 090 return true; 091 } 092 if (o == null || getClass() != o.getClass()) { 093 return false; 094 } 095 Change change = (Change) o; 096 return overwritten == change.overwritten 097 && outdated == change.outdated 098 && Objects.equals(field, change.field) 099 && Objects.equals(suggested, change.suggested) 100 && Objects.equals(previous, change.previous) 101 && Objects.equals(created, change.created) 102 && Objects.equals(author, change.author); 103 } 104 105 @Override 106 public int hashCode() { 107 return Objects.hash(field, suggested, previous, created, author, overwritten, outdated); 108 } 109}