Skip to content

Commit 2db804b

Browse files
author
Brian Melton
committed
Fix PUT/PATCH return types + clearing checkstyle
1 parent a421deb commit 2db804b

9 files changed

+27
-33
lines changed

Templates/Android/BaseModel.template.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
CustomT4Host host = (CustomT4Host) Host;
66
var model = host.CurrentModel;
77
CodeWriterAndroid writer = (CodeWriterAndroid) host.CodeWriter;
8-
bool logTemplateSrc = false;
8+
bool logTemplateSrc = true;
99
var c = host.CurrentType;
1010
#>
1111
<# if (logTemplateSrc) { #>

Templates/Android/generated/BaseClient.java.tt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ foreach (var prop in model.EntityContainer.Properties)
3535
var propertyName = prop.Name.ToUpperFirstChar();
3636
if (prop.IsCollection())
3737
{
38-
var requestCollectionBuilder = TypeCollectionRequestBuilder(prop);
3938
#>
4039

4140
/**

Templates/Android/generated/BaseEntityCollectionReferenceRequest.java.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* @param requestUrl The request url
1616
* @param client The service client
17-
* @param options The options for this request
17+
* @param requestOptions The options for this request
1818
*/
1919
public <#=BaseTypeCollectionReferenceRequest(c)#>(final String requestUrl, <#=IBaseClientType()#> client, final List<Option> requestOptions) {
2020
super(requestUrl, client, requestOptions, <#=BaseTypeCollectionResponse(c)#>.class, <#=ITypeCollectionPage(c)#>.class);

Templates/Android/generated/BaseEntityCollectionRequest.java.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* @param requestUrl The request url
1616
* @param client The service client
17-
* @param options The options for this request
17+
* @param requestOptions The options for this request
1818
*/
1919
public <#=BaseTypeCollectionRequest(c)#>(final String requestUrl, <#=IBaseClientType()#> client, final List<Option> requestOptions) {
2020
super(requestUrl, client, requestOptions, <#=BaseTypeCollectionResponse(c)#>.class, <#=ITypeCollectionPage(c)#>.class);

Templates/Android/generated/BaseEntityStreamRequestBuilder.java.tt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ if (c.AsOdcmClass() != null)
5050
foreach(var prop in c.AsOdcmClass().NavigationProperties())
5151
{
5252
var propName = prop.Name.ToUpperFirstChar();
53-
var propRequestBuilder = TypeRequestBuilder(prop);
5453
if (prop.IsCollection()) {
5554
#>
5655
public <#=ITypeCollectionRequestBuilder(prop)#> get<#=propName#>() {

Templates/Android/generated/BaseMethodRequest.java.tt

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (c.AsOdcmMethod().IsAction()) {
2424
if (c.AsOdcmMethod().ReturnType != null) {
2525
#>
2626
/**
27-
* Creates the <#=ReturnType(c)#>
27+
* Creates the <#=TypeName(c)#>
2828
*
2929
* @param callback The callback to be called after success or failure.
3030
*/
@@ -33,7 +33,7 @@ if (c.AsOdcmMethod().IsAction()) {
3333
}
3434

3535
/**
36-
* Creates the <#=ReturnType(c)#>
36+
* Creates the <#=TypeName(c)#>
3737
*
3838
* @return The <#=ReturnType(c)#>
3939
* @throws ClientException An exception occurs if there was an error while the request was sent.
@@ -93,7 +93,7 @@ if (c.AsOdcmMethod().IsAction()) {
9393
} else {
9494
#>
9595
/**
96-
* Creates the <#=ReturnType(c)#>
96+
* Creates the <#=TypeName(c)#>
9797
*
9898
* @param callback The callback to be called after success or failure.
9999
*/
@@ -113,9 +113,8 @@ if (c.AsOdcmMethod().IsAction()) {
113113
}
114114

115115
/**
116-
* Creates the <#=ReturnType(c)#>
116+
* Creates the <#=TypeName(c)#>
117117
*
118-
* @return The <#=ReturnType(c)#>
119118
* @throws ClientException An exception occurs if there was an error while the request was sent.
120119
*/
121120
public void post() throws ClientException {
@@ -128,7 +127,7 @@ if (c.AsOdcmMethod().IsAction()) {
128127
if (c.AsOdcmMethod().IsComposable) {
129128
#>
130129
/**
131-
* Patches the <#=ReturnType(c)#>
130+
* Patches the <#=TypeName(c)#>
132131
*
133132
* @param callback The callback to be called after success or failure
134133
*/
@@ -137,17 +136,17 @@ if (c.AsOdcmMethod().IsAction()) {
137136
}
138137

139138
/**
140-
* Patches the <#=ReturnType(c)#>
139+
* Patches the <#=TypeName(c)#>
141140
*
142141
* @return The <#=ReturnType(c)#>
143142
* @throws ClientException An exception occurs if there was an error while the request was sent
144143
*/
145-
public void patch() throws ClientException {
146-
this.send(HttpMethod.PATCH, null);
144+
public <#=ReturnType(c)#> patch() throws ClientException {
145+
return this.send(HttpMethod.PATCH, null);
147146
}
148147

149148
/**
150-
* Puts the <#=ReturnType(c)#>
149+
* Puts the <#=TypeName(c)#>
151150
*
152151
* @param callback The callback to be called after success or failure
153152
*/
@@ -156,13 +155,13 @@ if (c.AsOdcmMethod().IsAction()) {
156155
}
157156

158157
/**
159-
* Puts the <#=ReturnType(c)#>
158+
* Puts the <#=TypeName(c)#>
160159
*
161160
* @return The <#=ReturnType(c)#>
162161
* @throws ClientException An exception occurs if there was an error while the request was sent
163162
*/
164-
public void put() throws ClientException {
165-
this.send(HttpMethod.PUT, null);
163+
public <#=ReturnType(c)#> put() throws ClientException {
164+
return this.send(HttpMethod.PUT, null);
166165
}
167166
<#
168167
}

Templates/Android/generated/IBaseClient.java.tt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ foreach (var prop in model.EntityContainer.Properties)
1212
var propertyName = prop.Name.ToUpperFirstChar();
1313
if (prop.IsCollection())
1414
{
15-
var requestCollectionBuilder = TypeCollectionRequestBuilder(prop);
1615
#>
1716

1817
/**

Templates/Android/generated/IBaseEntityStreamRequestBuilder.java.tt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ if (c.AsOdcmClass() != null)
3333
foreach(var prop in c.AsOdcmClass().NavigationProperties())
3434
{
3535
var propName = prop.Name.ToUpperFirstChar();
36-
var propRequestBuilder = TypeRequestBuilder(prop);
3736
if (prop.IsCollection()) {
3837
#>
3938

Templates/Android/generated/IBaseMethodRequest.java.tt

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ if (c.AsOdcmMethod().IsAction()) {
1616
if (c.AsOdcmMethod().ReturnType != null) {
1717
#>
1818
/**
19-
* Creates the <#=ReturnType(c)#>
19+
* Creates the <#=TypeName(c)#>
2020
*
2121
* @param callback The callback to be called after success or failure.
2222
*/
2323
void post(final ICallback<<#=ReturnType(c)#>> callback);
2424

2525
/**
26-
* Creates the <#=ReturnType(c)#>
26+
* Creates the <#=TypeName(c)#>
2727
*
2828
* @return The <#=ReturnType(c)#>
2929
* @throws ClientException An exception occurs if there was an error while the request was sent.
@@ -73,16 +73,15 @@ if (c.AsOdcmMethod().IsAction()) {
7373
} else {
7474
#>
7575
/**
76-
* Creates the <#=ReturnType(c)#>
76+
* Creates the <#=TypeName(c)#>
7777
*
7878
* @param callback The callback to be called after success or failure.
7979
*/
8080
void post(final ICallback<Void> callback);
8181

8282
/**
83-
* Creates the <#=ReturnType(c)#>
83+
* Creates the <#=TypeName(c)#>
8484
*
85-
* @return The <#=ReturnType(c)#>
8685
* @throws ClientException An exception occurs if there was an error while the request was sent.
8786
*/
8887
void post() throws ClientException;
@@ -94,34 +93,34 @@ if (c.AsOdcmMethod().IsAction()) {
9493
if (c.AsOdcmMethod().IsComposable) {
9594
#>
9695
/**
97-
* Patches the <#=ReturnType(c)#>
96+
* Patches the <#=TypeName(c)#>
9897
*
9998
* @param callback The callback to be called after success or failure
10099
*/
101-
public void patch(final ICallback<<#=ReturnType(c)#>> callback);
100+
void patch(final ICallback<<#=ReturnType(c)#>> callback);
102101

103102
/**
104-
* Patches the <#=ReturnType(c)#>
103+
* Patches the <#=TypeName(c)#>
105104
*
106105
* @return The <#=ReturnType(c)#>
107106
* @throws ClientException An exception occurs if there was an error while the request was sent
108107
*/
109-
public void patch() throws ClientException;
108+
<#=ReturnType(c)#> patch() throws ClientException;
110109

111110
/**
112-
* Puts the <#=ReturnType(c)#>
111+
* Puts the <#=TypeName(c)#>
113112
*
114113
* @param callback The callback to be called after success or failure
115114
*/
116-
public void put(final ICallback<<#=ReturnType(c)#>> callback);
115+
void put(final ICallback<<#=ReturnType(c)#>> callback);
117116

118117
/**
119-
* Puts the <#=ReturnType(c)#>
118+
* Puts the <#=TypeName(c)#>
120119
*
121120
* @return The <#=ReturnType(c)#>
122121
* @throws ClientException An exception occurs if there was an error while the request was sent
123122
*/
124-
public void put() throws ClientException;
123+
<#=ReturnType(c)#> put() throws ClientException;
125124
<#
126125
}
127126
#>

0 commit comments

Comments
 (0)