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 protected
GenericUser(DataObject user, TinderClient client)
Constructs a new GenericUser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAge()
Gets the age of the user.List<String>
getBadges()
Gets a possibly emptyList
the badges the user has.String
getBio()
Gets the bio of the user.String
getBirthdate()
Gets the users' birthdate.Gender
getGender()
Gets theGender
of the user.String
getName()
Gets the name of the user.List<GenericPhoto>
getPhotos()
Gets aList
ofGenericPhotos
of the user.RestAction<UserProfile>
getUserProfile()
Gets theUserProfile
.boolean
hasBadges()
Whether this user has badges.RestAction<Void>
report(String cause, String text)
Reports the user.String
toString()
-
-
-
Constructor Detail
-
GenericUser
protected GenericUser(DataObject user, TinderClient client)
Constructs a new GenericUser.- Parameters:
user
- theDataObject
to construct the GenericUser fromclient
- the correspondingTinderClient
instance
-
-
Method Detail
-
getUserProfile
public RestAction<UserProfile> getUserProfile()
Gets theUserProfile
. AUserProfile
contains all available information about a user, while this class and its subtypes may only contain certain information.- Returns:
- the
UserProfile
wrapped 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:
true
if this user has badges- See Also:
()
-
getBadges
public List<String> getBadges()
Gets a possibly emptyList
the badges the user has.- Returns:
- a possibly empty
List
the badges
-
getPhotos
public List<GenericPhoto> getPhotos()
Gets aList
ofGenericPhotos
of the user.- Returns:
- a
List
ofGenericPhotos
-
-