public static StringJoiner toStringJoiner()

in streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/search/SearchUtil.java [34:129]


  public static StringJoiner toStringJoiner(ThirtyDaySearchOperator operator) {
    StringJoiner stringJoiner = new StringJoiner(" ");
    if(operator.getNot()) {
      stringJoiner.add("-");
    }
    stringJoiner.add("(");
    for( String keyword : operator.getKeywords()) {
      stringJoiner.add(keyword);
    }
    for( String emoji : operator.getEmojis()) {
      stringJoiner.add(emoji);
    }
    for( String exact_phrase : operator.getExactPhrases()) {
      stringJoiner.add(phrase(exact_phrase));
    }
    for( String from : operator.getFroms()) {
      stringJoiner.add("from:" + from);
    }
    for( String to : operator.getTos()) {
      stringJoiner.add("to:" + to);
    }
    for( String mention : operator.getMentions()) {
      stringJoiner.add("@" + mention);
    }
    for( String retweets_of : operator.getRetweetsOfs()) {
      stringJoiner.add("retweets_of:" + retweets_of);
    }
    for( String hashtag : operator.getHashtags()) {
      stringJoiner.add("#" + hashtag);
    }
    for( String url : operator.getUrls()) {
      stringJoiner.add("url:" + phrase(url));
    }
    for( String bio : operator.getBios()) {
      stringJoiner.add("bio:" + phrase(bio));
    }
    for( String bio_location : operator.getBioLocations()) {
      stringJoiner.add("bio_location:" + phrase(bio_location));
    }
    for( String bio_name : operator.getBioNames()) {
      stringJoiner.add("bio_name:" + bio_name);
    }
    for( String place : operator.getPlaces()) {
      stringJoiner.add("place:" + place);
    }
    for( String place_country : operator.getPlaceCountrys()) {
      stringJoiner.add("place_country:" + phrase(place_country));
    }
    for( String point_radius : operator.getPointRadiuses()) {
      stringJoiner.add("point_radius:" + point_radius);
    }
    for( String bounding_box : operator.getBoundingBoxes()) {
      stringJoiner.add("bounding_box:" + bounding_box);
    }
    for( String time_zone : operator.getTimeZones()) {
      stringJoiner.add("time_zone:" + time_zone);
    }
    if( operator.getProfileCountry() != null) {
      stringJoiner.add("profile_country:" + operator.getProfileCountry());
    }
    if( operator.getProfileRegion() != null) {
      stringJoiner.add("profile_region:" + operator.getProfileRegion());
    }
    if( operator.getProfileLocality() != null) {
      stringJoiner.add("profile_locality:" + operator.getProfileLocality());
    }
    if( operator.getHasImages() ) {
      stringJoiner.add("has:images");
    }
    if( operator.getHasLinks() ) {
      stringJoiner.add("has:links");
    }
    if( operator.getHasMedia() ) {
      stringJoiner.add("has:media");
    }
    if( operator.getHasProfileGeo() ) {
      stringJoiner.add("has:profile_geo");
    }
    if( operator.getHasVideos() ) {
      stringJoiner.add("has:video");
    }
    if(operator.getAnds().size() > 0) {
      for( ThirtyDaySearchOperator suboperator : operator.getAnds()) {
        stringJoiner.add("AND");
        stringJoiner.add(SearchUtil.toString(suboperator));
      }
    }
    if(operator.getOrs().size() > 0) {
      for( ThirtyDaySearchOperator suboperator : operator.getOrs()) {
        stringJoiner.add("OR");
        stringJoiner.add(SearchUtil.toString(suboperator));
      }
    }
    stringJoiner.add(")");
    return stringJoiner;
  }