Example usage for twitter4j User getURLEntity

List of usage examples for twitter4j User getURLEntity

Introduction

In this page you can find the example usage for twitter4j User getURLEntity.

Prototype

URLEntity getURLEntity();

Source Link

Document

Returns URL entity for user's URL.

Usage

From source file:com.freshdigitable.udonroad.module.realm.UserRealm.java

License:Apache License

UserRealm(final User user) {
    this.id = user.getId();
    this.profileImageURLHttps = user.getProfileImageURLHttps();
    this.miniProfileImageURLHttps = user.getMiniProfileImageURLHttps();
    this.name = user.getName();
    this.screenName = user.getScreenName();
    this.description = user.getDescription();
    this.profileBannerMobileURL = user.getProfileBannerMobileURL();
    this.statusesCount = user.getStatusesCount();
    this.followersCount = user.getFollowersCount();
    this.friendsCount = user.getFriendsCount();
    this.favoritesCount = user.getFavouritesCount();
    this.profileLinkColor = user.getProfileLinkColor();
    this.descriptionURLEntities = URLEntityRealm.createList(user.getDescriptionURLEntities());
    this.url = user.getURL();
    if (user.getURLEntity() != null) {
        this.urlEntity = new URLEntityRealm(user.getURLEntity());
    }/*from w  w w . ja va 2 s. com*/
    this.location = user.getLocation();
    this.verified = user.isVerified();
    this.isProtected = user.isProtected();
}

From source file:com.freshdigitable.udonroad.module.realm.UserRealm.java

License:Apache License

void merge(@NonNull User u, @NonNull Realm realm) {
    if (u.getDescription() != null) { // description is nullable
        this.description = u.getDescription();
        final URLEntity[] descriptionURLEntities = u.getDescriptionURLEntities();
        if (descriptionURLEntities != null && descriptionURLEntities.length > 0) {
            this.descriptionURLEntities.clear();
            for (URLEntity url : descriptionURLEntities) {
                this.descriptionURLEntities.add(URLEntityRealm.findOrCreateFromRealm(url, realm));
            }/*from  ww w  . j a  v  a2s. com*/
        }
    }
    this.favoritesCount = u.getFavouritesCount();
    this.followersCount = u.getFollowersCount();
    this.friendsCount = u.getFriendsCount();
    this.miniProfileImageURLHttps = u.getMiniProfileImageURLHttps();
    this.name = u.getName();
    this.profileBannerMobileURL = u.getProfileBannerMobileURL();
    this.profileImageURLHttps = u.getProfileImageURLHttps();
    this.profileLinkColor = u.getProfileLinkColor();
    this.screenName = u.getScreenName();
    this.statusesCount = u.getStatusesCount();
    this.url = u.getURL();
    final URLEntity urlEntity = u.getURLEntity();
    if (urlEntity != null && isNewUrlEntity(urlEntity)) {
        this.urlEntity = URLEntityRealm.findOrCreateFromRealm(urlEntity, realm);
    }
    this.location = u.getLocation();
    this.verified = u.isVerified();
    this.isProtected = u.isProtected();
}

From source file:com.freshdigitable.udonroad.UserInfoView.java

License:Apache License

private void bindURL(User user) {
    final URLEntity urlEntity = user.getURLEntity();
    if (urlEntity != null) {
        final String displayURL = urlEntity.getDisplayURL();
        final String expandedURL = urlEntity.getExpandedURL();
        final String plainUrl = urlEntity.getURL();
        bindURL(displayURL != null ? displayURL : plainUrl, expandedURL != null ? expandedURL : plainUrl);
        return;/*from  ww  w  .j  a v  a 2 s  .  c  o m*/
    }
    final String url = user.getURL();
    if (!TextUtils.isEmpty(url)) {
        bindURL(url, url);
        return;
    }
    urlIcon.setVisibility(GONE);
    this.url.setVisibility(GONE);
}

From source file:org.tweetalib.android.model.TwitterUser.java

License:Apache License

public TwitterUser(User user) {
    mId = user.getId();/*from  w  w w .  java  2  s  . c  om*/
    mScreenName = user.getScreenName();
    mName = user.getName();
    mDescription = user.getDescription();
    ArrayList<URLEntity> urlEntityArrayList = new ArrayList<URLEntity>();
    if (user.getDescriptionURLEntities() != null) {
        urlEntityArrayList = new ArrayList<URLEntity>(Arrays.asList(user.getDescriptionURLEntities()));
    }

    if (user.getURL() != null) {
        mUrl = user.getURL();
        urlEntityArrayList.add(user.getURLEntity());
    }

    mUrlEntities = urlEntityArrayList.toArray(new URLEntity[urlEntityArrayList.size()]);

    if (user.getLocation() != null && !user.getLocation().equals("")) {
        mLocation = user.getLocation();
    }

    if (user.getOriginalProfileImageURLHttps() != null) {
        mProfileImageUrlOriginal = user.getOriginalProfileImageURLHttps();
    }

    if (user.getBiggerProfileImageURLHttps() != null) {
        mProfileImageUrlBigger = user.getBiggerProfileImageURLHttps();
    }

    if (user.getProfileImageURLHttps() != null) {
        mProfileImageUrlNormal = user.getProfileImageURLHttps();
    }

    if (user.getMiniProfileImageURLHttps() != null) {
        mProfileImageUrlMini = user.getMiniProfileImageURLHttps();
    }

    mStatusesCount = user.getStatusesCount();
    mFriendsCount = user.getFriendsCount();
    mFollowersCount = user.getFollowersCount();
    mFavoritesCount = user.getFavouritesCount();
    mListedCount = user.getListedCount();
    mVerified = user.isVerified();
    mProtected = user.isProtected();
    mSocialNetType = SocialNetConstant.Type.Twitter;
}