sys1yagi / mastodon4j

mastodon client for java, kotlin https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md
MIT License
135 stars 28 forks source link

Add MastodonRequest. #48

Closed sys1yagi closed 7 years ago

sys1yagi commented 7 years ago

Support to get raw json #36

TODO

sample

kotllin

val client = //
val publicMethod = Public(client)
publicMethod.getInstance()
  .doOnJson { jsonString -> 
    println(jsonString)
  }
  .execute() 

publicMethod.getLocalPublic()
  .doOnJson { jsonString -> 
    // take 20 times
    println(jsonString)
  }
  .execute() 

java

MastodonClient client = new MastodonClient("mstdn.jp", new OkHttpClient(), new Gson());
Public publicMethod = new Public(client);

try {
  Pageable<Status> statuses = publicMethod.getLocalPublic(new Range())
    .doOnJson(json -> {
      // take 20 times
      System.out.println(json);
    })
    .execute();
} catch (Mastodon4jRequestException e) {
  e.printStackTrace();
}
codecov-io commented 7 years ago

Codecov Report

Merging #48 into master will increase coverage by 15.77%. The diff coverage is 94.79%.

Impacted file tree graph

@@              Coverage Diff              @@
##             master      #48       +/-   ##
=============================================
+ Coverage     62.29%   78.06%   +15.77%     
- Complexity      141      147        +6     
=============================================
  Files            39       40        +1     
  Lines           496      497        +1     
  Branches         66       27       -39     
=============================================
+ Hits            309      388       +79     
+ Misses          132       95       -37     
+ Partials         55       14       -41
Impacted Files Coverage Δ Complexity Δ
...om/sys1yagi/mastodon4j/extension/ListExtensions.kt 100% <ø> (ø) 0 <0> (ø) :arrow_down:
.../java/com/sys1yagi/mastodon4j/api/method/Blocks.kt 100% <100%> (+33.33%) 2 <1> (ø) :arrow_down:
...n/java/com/sys1yagi/mastodon4j/api/method/Mutes.kt 100% <100%> (+33.33%) 2 <1> (ø) :arrow_down:
...java/com/sys1yagi/mastodon4j/api/method/Follows.kt 100% <100%> (+25%) 2 <0> (ø) :arrow_down:
...ava/com/sys1yagi/mastodon4j/api/method/Statuses.kt 82% <100%> (+32.87%) 11 <9> (ø) :arrow_down:
...m/sys1yagi/mastodon4j/api/method/FollowRequests.kt 45.45% <100%> (+12.12%) 2 <1> (ø) :arrow_down:
...n/java/com/sys1yagi/mastodon4j/api/method/Media.kt 100% <100%> (+22.22%) 2 <0> (ø) :arrow_down:
...a/com/sys1yagi/mastodon4j/api/method/Favourites.kt 100% <100%> (+33.33%) 2 <1> (ø) :arrow_down:
...va/com/sys1yagi/mastodon4j/api/method/Timelines.kt 100% <100%> (+33.33%) 2 <1> (ø) :arrow_down:
...ava/com/sys1yagi/mastodon4j/api/method/Accounts.kt 90.76% <100%> (+37.34%) 15 <12> (ø) :arrow_down:
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6ff13a6...892a338. Read the comment docs.