twitter4j
Class RelationshipJSONImpl

java.lang.Object
  extended by twitter4j.TwitterResponseImpl
      extended by twitter4j.RelationshipJSONImpl
All Implemented Interfaces:
java.io.Serializable, Relationship, TwitterResponse

 class RelationshipJSONImpl
extends TwitterResponseImpl
implements Relationship, java.io.Serializable

A data class that has detailed information about a relationship between two users

Since:
Twitter4J 2.1.0
Author:
Perry Sakkaris - psakkaris at gmail.com
See Also:
GET friendships/show | dev.twitter.com

Field Summary
private static long serialVersionUID
           
private  boolean sourceBlockingTarget
           
private  boolean sourceFollowedByTarget
           
private  boolean sourceFollowingTarget
           
private  boolean sourceNotificationsEnabled
           
private  long sourceUserId
           
private  java.lang.String sourceUserScreenName
           
private  long targetUserId
           
private  java.lang.String targetUserScreenName
           
 
Constructor Summary
RelationshipJSONImpl(twitter4j.internal.http.HttpResponse res)
           
RelationshipJSONImpl(twitter4j.internal.http.HttpResponse res, twitter4j.internal.org.json.JSONObject json)
           
RelationshipJSONImpl(twitter4j.internal.org.json.JSONObject json)
           
 
Method Summary
(package private) static ResponseList<Relationship> createRelationshipList(twitter4j.internal.http.HttpResponse res)
           
 boolean equals(java.lang.Object o)
           
 long getSourceUserId()
          Returns the source user id
 java.lang.String getSourceUserScreenName()
          Returns the source user screen name
 long getTargetUserId()
          Returns the target user id
 java.lang.String getTargetUserScreenName()
          Returns the target user screen name
 int hashCode()
           
 boolean isSourceBlockingTarget()
          Returns if the source user is blocking the target user
 boolean isSourceFollowedByTarget()
          Checks if source user is being followed by target user
 boolean isSourceFollowingTarget()
          Checks if source user is following target user
 boolean isSourceNotificationsEnabled()
          Checks if the source user has enabled notifications for updates of the target user
 boolean isTargetFollowedBySource()
          Checks if target user is being followed by source user.
This method is equivalent to isSourceFollowingTarget().
 boolean isTargetFollowingSource()
          Checks if target user is following source user.
This method is equivalent to isSourceFollowedByTarget().
 java.lang.String toString()
           
 
Methods inherited from class twitter4j.TwitterResponseImpl
getRateLimitStatus
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface twitter4j.TwitterResponse
getRateLimitStatus
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

targetUserId

private final long targetUserId

targetUserScreenName

private final java.lang.String targetUserScreenName

sourceBlockingTarget

private final boolean sourceBlockingTarget

sourceNotificationsEnabled

private final boolean sourceNotificationsEnabled

sourceFollowingTarget

private final boolean sourceFollowingTarget

sourceFollowedByTarget

private final boolean sourceFollowedByTarget

sourceUserId

private final long sourceUserId

sourceUserScreenName

private final java.lang.String sourceUserScreenName
Constructor Detail

RelationshipJSONImpl

RelationshipJSONImpl(twitter4j.internal.http.HttpResponse res)
               throws TwitterException
Throws:
TwitterException

RelationshipJSONImpl

RelationshipJSONImpl(twitter4j.internal.org.json.JSONObject json)
               throws TwitterException
Throws:
TwitterException

RelationshipJSONImpl

RelationshipJSONImpl(twitter4j.internal.http.HttpResponse res,
                     twitter4j.internal.org.json.JSONObject json)
               throws TwitterException
Throws:
TwitterException
Method Detail

createRelationshipList

static ResponseList<Relationship> createRelationshipList(twitter4j.internal.http.HttpResponse res)
                                                  throws TwitterException
Throws:
TwitterException

getSourceUserId

public long getSourceUserId()
Returns the source user id

Specified by:
getSourceUserId in interface Relationship
Returns:
the source user id

getTargetUserId

public long getTargetUserId()
Returns the target user id

Specified by:
getTargetUserId in interface Relationship
Returns:
target user id

isSourceBlockingTarget

public boolean isSourceBlockingTarget()
Returns if the source user is blocking the target user

Specified by:
isSourceBlockingTarget in interface Relationship
Returns:
if the source is blocking the target

getSourceUserScreenName

public java.lang.String getSourceUserScreenName()
Returns the source user screen name

Specified by:
getSourceUserScreenName in interface Relationship
Returns:
returns the source user screen name

getTargetUserScreenName

public java.lang.String getTargetUserScreenName()
Returns the target user screen name

Specified by:
getTargetUserScreenName in interface Relationship
Returns:
the target user screen name

isSourceFollowingTarget

public boolean isSourceFollowingTarget()
Checks if source user is following target user

Specified by:
isSourceFollowingTarget in interface Relationship
Returns:
true if source user is following target user

isTargetFollowingSource

public boolean isTargetFollowingSource()
Checks if target user is following source user.
This method is equivalent to isSourceFollowedByTarget().

Specified by:
isTargetFollowingSource in interface Relationship
Returns:
true if target user is following source user

isSourceFollowedByTarget

public boolean isSourceFollowedByTarget()
Checks if source user is being followed by target user

Specified by:
isSourceFollowedByTarget in interface Relationship
Returns:
true if source user is being followed by target user

isTargetFollowedBySource

public boolean isTargetFollowedBySource()
Checks if target user is being followed by source user.
This method is equivalent to isSourceFollowingTarget().

Specified by:
isTargetFollowedBySource in interface Relationship
Returns:
true if target user is being followed by source user

isSourceNotificationsEnabled

public boolean isSourceNotificationsEnabled()
Checks if the source user has enabled notifications for updates of the target user

Specified by:
isSourceNotificationsEnabled in interface Relationship
Returns:
true if source user enabled notifications for target user

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object