Class GenericUser
- java.lang.Object
-
- com.rednit.tinder4j.api.entities.Entity
-
- com.rednit.tinder4j.api.entities.user.GenericUser
-
- Direct Known Subclasses:
MatchedUser,SelfUser,SwipeableUser
public abstract class GenericUser extends Entity
Abstract top level class for users.- Since:
- 1.0.0
- Version:
- 1.0.0
- Author:
- Kaktushose
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGenericUser(DataObject user, TinderClient client)Constructs a new GenericUser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAge()Gets the age of the user.List<String>getBadges()Gets a possibly emptyListthe badges the user has.StringgetBio()Gets the bio of the user.StringgetBirthdate()Gets the users' birthdate.GendergetGender()Gets theGenderof the user.StringgetName()Gets the name of the user.List<GenericPhoto>getPhotos()Gets aListofGenericPhotosof the user.RestAction<UserProfile>getUserProfile()Gets theUserProfile.booleanhasBadges()Whether this user has badges.RestAction<Void>report(String cause, String text)Reports the user.StringtoString()
-
-
-
Constructor Detail
-
GenericUser
protected GenericUser(DataObject user, TinderClient client)
Constructs a new GenericUser.- Parameters:
user- theDataObjectto construct the GenericUser fromclient- the correspondingTinderClientinstance
-
-
Method Detail
-
getUserProfile
public RestAction<UserProfile> getUserProfile()
Gets theUserProfile. AUserProfilecontains all available information about a user, while this class and its subtypes may only contain certain information.- Returns:
- the
UserProfilewrapped in aRestAction
-
report
public RestAction<Void> report(String cause, String text)
Reports the user.- Parameters:
cause- the report causetext- the detailed report text- Returns:
RestAction
-
getBio
public String getBio()
Gets the bio of the user.- Returns:
- the bio of the user
-
getBirthdate
public String getBirthdate()
Gets the users' birthdate. Note: This does only display the real birthdate if it's theSelfUser.- Returns:
- the users' birthdate
-
getAge
public int getAge()
Gets the age of the user. UsesgetBirthdate()to calculate the age.- Returns:
- the age of the user
- Throws:
UnsupportedOperationException- if the birthdate is not available
-
getName
public String getName()
Gets the name of the user.- Returns:
- the name of the user
-
hasBadges
public boolean hasBadges()
Whether this user has badges.- Returns:
trueif this user has badges- See Also:
()
-
getBadges
public List<String> getBadges()
Gets a possibly emptyListthe badges the user has.- Returns:
- a possibly empty
Listthe badges
-
getPhotos
public List<GenericPhoto> getPhotos()
Gets aListofGenericPhotosof the user.- Returns:
- a
ListofGenericPhotos
-
-