-
-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SharedUser type and add users field to UsersShared
- Loading branch information
Showing
2 changed files
with
84 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
library/src/main/java/com/pengrad/telegrambot/model/shared/SharedUser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.pengrad.telegrambot.model.shared; | ||
|
||
import com.pengrad.telegrambot.model.PhotoSize; | ||
|
||
import java.io.Serializable; | ||
import java.util.Arrays; | ||
import java.util.Objects; | ||
|
||
public class SharedUser implements Serializable { | ||
|
||
private final static long serialVersionUID = 0L; | ||
|
||
private Integer user_id; | ||
private String first_name; | ||
private String last_name; | ||
private String username; | ||
private PhotoSize[] photo; | ||
|
||
public Integer userId() { | ||
return user_id; | ||
} | ||
|
||
public String firstName() { | ||
return first_name; | ||
} | ||
|
||
public String lastName() { | ||
return last_name; | ||
} | ||
|
||
public String username() { | ||
return username; | ||
} | ||
|
||
public PhotoSize[] photo() { | ||
return photo; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (!(o instanceof SharedUser)) return false; | ||
SharedUser that = (SharedUser) o; | ||
return Objects.equals(user_id, that.user_id) && Objects.equals(first_name, that.first_name) && Objects.equals(last_name, that.last_name) && Objects.equals(username, that.username) && Arrays.equals(photo, that.photo); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = Objects.hash(user_id, first_name, last_name, username); | ||
result = 31 * result + Arrays.hashCode(photo); | ||
return result; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "SharedUser{" + | ||
"user_id=" + user_id + | ||
", first_name='" + first_name + '\'' + | ||
", last_name='" + last_name + '\'' + | ||
", username='" + username + '\'' + | ||
", photo=" + Arrays.toString(photo) + | ||
'}'; | ||
} | ||
} |