SHUB user added

This commit is contained in:
Lucio Lelii 2022-10-04 11:50:04 +02:00
parent a4012a2504
commit 18a51aa0e3
1 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,49 @@
package org.gcube.common.storagehub.model.types;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@JsonIgnoreProperties(ignoreUnknown = true)
@AllArgsConstructor
@NoArgsConstructor
@Data
public class SHUBUser implements Comparable<SHUBUser> {
private String userName;
private long homeVersion;
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SHUBUser other = (SHUBUser) obj;
if (userName == null) {
if (other.userName != null)
return false;
} else if (!userName.equals(other.userName))
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((userName == null) ? 0 : userName.hashCode());
return result;
}
@Override
public int compareTo(SHUBUser user) {
return userName.compareTo(user.getUserName());
}
}