Skip to content

Commit

Permalink
update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
NeelPatel21 committed Sep 16, 2017
1 parent 3ac6b62 commit 8d39970
Show file tree
Hide file tree
Showing 49 changed files with 399 additions and 145 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/com/neel/articleshub/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.neel.articleshubapi.restapi.request.RequestTask;

import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;

import static com.neel.articleshubapi.restapi.request.HeaderTools.CONTENT_TYPE_JSON;

Expand Down Expand Up @@ -60,6 +61,7 @@ protected void onStart(){
login, HttpMethod.POST, HeaderTools.CONTENT_TYPE_JSON, HeaderTools.ACCEPT_TEXT);
rt4.execute(getResources().getString(R.string.ser_base_url)+"/authentication/user1");
Log.i("login",rt4.getObj());
HttpStatus status = rt4.getHttpStatus();
RequestTask<String> rt5=new RequestTask<String>(String.class,
HttpMethod.POST, HeaderTools.CONTENT_TYPE_JSON, HeaderTools.makeAuth("402881825d691eaa015d693baadf0000"));
rt5.execute(getResources().getString(R.string.ser_base_url)+"/user/juser/like/13");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* Created by Neel Patel on 26-07-2017.
* @author Neel Patel
* @version 1.0.0
* @version 2.0.0
*/

public class UserDetail {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,19 @@
* following snapshot of code can be used to update article having id '1'<br>
* <pre>
* {@code
ArticleDetail article = new ArticleDetail();
article.setAuthor("username");
article.setTitle("android test");
article.setArticleId(1);
article.getContent().add("android update");
AddRequestTask<String,ArticleDetail> rt6=new AddRequestTask<String, ArticleDetail>(String.class,
AddRequestTask<String,ArticleDetail> rt=new AddRequestTask<String, ArticleDetail>(String.class,
article, HttpMethod.PUT, HeaderTools.CONTENT_TYPE_JSON,
HeaderTools.makeAuth("402881825d691eaa015d693baadf0000"));
rt6.execute(BASE_URL+"/article/1");
HeaderTools.makeAuth(token));
rt.execute(BASE_URL+"/article/1");
// initiate waiting logic
rt.getObj();
// terminate waiting logic
HttpStatus status = rt.getHttpStatus();
}
* </pre>
* <br><br>
Expand All @@ -61,10 +66,13 @@
UserDetail login =new UserDetail();
login.setUserName("username");
login.setPass("pass");
AddRequestTask<String,UserDetail> rt4=new AddRequestTask<String, UserDetail>(String.class,
AddRequestTask<String,UserDetail> rt=new AddRequestTask<String, UserDetail>(String.class,
login, HttpMethod.POST, HeaderTools.CONTENT_TYPE_JSON, HeaderTools.ACCEPT_TEXT);
rt4.execute(BASE_URL+"/authentication/username");
String token = rt4.getObj());
rt.execute(BASE_URL+"/authentication/username");
// initiate waiting logic
String token = rt.getObj());
// terminate waiting logic
HttpStatus status = rt.getHttpStatus();
}
* </pre>
* <br><br>
Expand All @@ -73,7 +81,7 @@
* @see com.neel.articleshubapi.restapi.request.RequestTask
* @see com.neel.articleshubapi.restapi.request.HeaderTools
* @see android.os.AsyncTask
* @version 1.0.0
* @version 2.0.0
*/

public class AddRequestTask<T,R> extends AsyncTask<String,Void,T> {
Expand Down Expand Up @@ -132,6 +140,9 @@ public T getObj(){
return null;
}

/**
* @return http status code of last request
*/
public HttpStatus getHttpStatus() {
return httpStatus;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ methods of this class as they contains network access permission which is not
* @author Neel Patel
* @see com.neel.articleshubapi.restapi.request.RequestTask
* @see com.neel.articleshubapi.restapi.request.AddRequestTask
* @version 1.0.0
* @version 2.0.0
*/

public class RequestHandler{
Expand Down Expand Up @@ -156,6 +156,9 @@ public <T> T getResource(Class<T> type, String url){
return getResource(type, url, HttpMethod.GET);
}

/**
* @return http status code of last request
*/
public HttpStatus getHttpStatus() {
return httpStatus;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
* {@code
RequestTask<ArticleDetail> rt=new RequestTask<>(ArticleDetail.class,CONTENT_TYPE_JSON);
rt.execute(BASE_URL+"/article/"+2);
// initiate waiting logic
ArticleDetail article=rt.getObj();
// terminate waiting logic
HttpStatus status = rt.getHttpStatus();
}
* </pre>
* <br><br>
Expand All @@ -54,10 +57,12 @@
who liked article with id '1'.<br>
* <pre>
* {@code
RequestTask<ShortUserDetail[]> rt2=
RequestTask<ShortUserDetail[]> rt=
new RequestTask<>(ShortUserDetail[].class,CONTENT_TYPE_JSON);
rt2.execute(BASE_URL+"/article/1/likes");
ShortUserDetail[] ud=rt2.getObj();
rt.execute(BASE_URL+"/article/1/likes");
// initiate waiting logic
ShortUserDetail[] ud=rt.getObj();
// terminate waiting logic
}
* </pre>
* <br><br>
Expand All @@ -67,10 +72,14 @@
* following snapshot of code can be used to add like on article.<br>
* <pre>
* {@code
RequestTask<String> rt5=new RequestTask<String>(String.class, HttpMethod.POST,
RequestTask<String> rt=new RequestTask<String>(String.class, HttpMethod.POST,
HeaderTools.CONTENT_TYPE_JSON,
HeaderTools.makeAuth("402881825d691eaa015d693baadf0000"));
rt5.execute(BASE_URL+"/user/username/like/1");
HeaderTools.makeAuth(token));
rt.execute(BASE_URL+"/user/username/like/1");
// initiate waiting logic
rt.getObj();
// terminate waiting logic
HttpStatus status = rt.getHttpStatus();
}
* </pre>
* <br><br>
Expand All @@ -79,7 +88,7 @@
* @see com.neel.articleshubapi.restapi.request.AddRequestTask
* @see com.neel.articleshubapi.restapi.request.HeaderTools
* @see android.os.AsyncTask
* @version 1.0.0
* @version 2.0.0
*/

public class RequestTask<T> extends AsyncTask<String,Void,T> {
Expand Down Expand Up @@ -150,6 +159,9 @@ public T getObj(){
return null;
}

/**
* @return http status code of last request
*/
public HttpStatus getHttpStatus() {
return httpStatus;
}
Expand Down
4 changes: 2 additions & 2 deletions docs/allclasses-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Sun Sep 03 13:18:50 IST 2017 -->
<!-- Generated by javadoc (1.8.0_102) on Sat Sep 16 17:49:41 IST 2017 -->
<title>All Classes</title>
<meta name="date" content="2017-09-03">
<meta name="date" content="2017-09-16">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/allclasses-noframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Sun Sep 03 13:18:50 IST 2017 -->
<!-- Generated by javadoc (1.8.0_102) on Sat Sep 16 17:49:41 IST 2017 -->
<title>All Classes</title>
<meta name="date" content="2017-09-03">
<meta name="date" content="2017-09-16">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/com/neel/articleshubapi/ExampleInstrumentedTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Sun Sep 03 13:18:48 IST 2017 -->
<!-- Generated by javadoc (1.8.0_102) on Sat Sep 16 17:49:39 IST 2017 -->
<title>ExampleInstrumentedTest</title>
<meta name="date" content="2017-09-03">
<meta name="date" content="2017-09-16">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/com/neel/articleshubapi/ExampleUnitTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Sun Sep 03 13:18:48 IST 2017 -->
<!-- Generated by javadoc (1.8.0_102) on Sat Sep 16 17:49:39 IST 2017 -->
<title>ExampleUnitTest</title>
<meta name="date" content="2017-09-03">
<meta name="date" content="2017-09-16">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/com/neel/articleshubapi/package-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Sun Sep 03 13:18:49 IST 2017 -->
<!-- Generated by javadoc (1.8.0_102) on Sat Sep 16 17:49:40 IST 2017 -->
<title>com.neel.articleshubapi</title>
<meta name="date" content="2017-09-03">
<meta name="date" content="2017-09-16">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/com/neel/articleshubapi/package-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Sun Sep 03 13:18:49 IST 2017 -->
<!-- Generated by javadoc (1.8.0_102) on Sat Sep 16 17:49:40 IST 2017 -->
<title>com.neel.articleshubapi</title>
<meta name="date" content="2017-09-03">
<meta name="date" content="2017-09-16">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/com/neel/articleshubapi/package-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Sun Sep 03 13:18:49 IST 2017 -->
<!-- Generated by javadoc (1.8.0_102) on Sat Sep 16 17:49:40 IST 2017 -->
<title>com.neel.articleshubapi Class Hierarchy</title>
<meta name="date" content="2017-09-03">
<meta name="date" content="2017-09-16">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/com/neel/articleshubapi/restapi/beans/ArticleDetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Sun Sep 03 13:18:48 IST 2017 -->
<!-- Generated by javadoc (1.8.0_102) on Sat Sep 16 17:49:39 IST 2017 -->
<title>ArticleDetail</title>
<meta name="date" content="2017-09-03">
<meta name="date" content="2017-09-16">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/com/neel/articleshubapi/restapi/beans/CommentDetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Sun Sep 03 13:18:48 IST 2017 -->
<!-- Generated by javadoc (1.8.0_102) on Sat Sep 16 17:49:39 IST 2017 -->
<title>CommentDetail</title>
<meta name="date" content="2017-09-03">
<meta name="date" content="2017-09-16">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions docs/com/neel/articleshubapi/restapi/beans/Link.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Sun Sep 03 13:18:48 IST 2017 -->
<!-- Generated by javadoc (1.8.0_102) on Sat Sep 16 17:49:39 IST 2017 -->
<title>Link</title>
<meta name="date" content="2017-09-03">
<meta name="date" content="2017-09-16">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Sun Sep 03 13:18:48 IST 2017 -->
<!-- Generated by javadoc (1.8.0_102) on Sat Sep 16 17:49:39 IST 2017 -->
<title>ShortArticleDetail</title>
<meta name="date" content="2017-09-03">
<meta name="date" content="2017-09-16">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
Expand Down
Loading

0 comments on commit 8d39970

Please sign in to comment.