Skip to content

Commit

Permalink
Merge pull request Azure#866 from jianghaolu/rfc1123
Browse files Browse the repository at this point in the history
Azure#742: Hide DateTimeRfc1123
  • Loading branch information
jianghaolu committed Mar 22, 2016
2 parents f2319c8 + a8419ee commit 081e7f6
Show file tree
Hide file tree
Showing 19 changed files with 326 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public override string MethodParameterDeclaration
}
else
{
declarations.Add("final " + parameter.Type.ToString() + " " + parameter.Name);
declarations.Add("final " + parameter.Type.UserHandledType().ToString() + " " + parameter.Name);
}
}

Expand All @@ -138,7 +138,7 @@ public override string MethodRequiredParameterDeclaration
List<string> declarations = new List<string>();
foreach (var parameter in LocalParameters.Where(p => !p.IsConstant && p.IsRequired))
{
declarations.Add("final " + parameter.Type.ToString() + " " + parameter.Name);
declarations.Add("final " + parameter.Type.UserHandledType().ToString() + " " + parameter.Name);
}

var declaration = string.Join(", ", declarations);
Expand Down Expand Up @@ -528,6 +528,19 @@ public override string GenericReturnTypeString
}
}

public override string CallbackGenericTypeString
{
get
{
if (ReturnType.Body is SequenceType &&
(this.IsPagingOperation || this.IsPagingNextOperation))
{
return JavaCodeNamer.WrapPrimitiveType(ReturnType.Body).Name;
}
return base.CallbackGenericTypeString;
}
}

public override string ServiceCallConstruction
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
else
{
@if (Model.LocalParameters.Any(p => !p.IsConstant && !p.IsRequired))
if (Model.LocalParameters.Any(p => !p.IsConstant && !p.IsRequired))
{
<text>
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package fixtures.bodycomplex.models;

import com.microsoft.rest.DateTimeRfc1123;
import org.joda.time.DateTime;

/**
* The Datetimerfc1123Wrapper model.
Expand All @@ -31,35 +32,35 @@ public class Datetimerfc1123Wrapper {
*
* @return the field value
*/
public DateTimeRfc1123 getField() {
return this.field;
public DateTime getField() {
return this.field.getDateTime();
}

/**
* Set the field value.
*
* @param field the field value to set
*/
public void setField(DateTimeRfc1123 field) {
this.field = field;
public void setField(DateTime field) {
this.field = new DateTimeRfc1123(field);
}

/**
* Get the now value.
*
* @return the now value
*/
public DateTimeRfc1123 getNow() {
return this.now;
public DateTime getNow() {
return this.now.getDateTime();
}

/**
* Set the now value.
*
* @param now the now value to set
*/
public void setNow(DateTimeRfc1123 now) {
this.now = now;
public void setNow(DateTime now) {
this.now = new DateTimeRfc1123(now);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

package fixtures.bodydatetimerfc1123;

import com.microsoft.rest.DateTimeRfc1123;
import com.microsoft.rest.ServiceCall;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceResponse;
import fixtures.bodydatetimerfc1123.models.ErrorException;
import java.io.IOException;
import org.joda.time.DateTime;

/**
* An instance of this class provides access to all the operations defined
Expand All @@ -29,7 +29,7 @@ public interface Datetimerfc1123Operations {
* @throws IOException exception thrown from serialization/deserialization
* @return the DateTimeRfc1123 object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<DateTimeRfc1123> getNull() throws ErrorException, IOException;
ServiceResponse<DateTime> getNull() throws ErrorException, IOException;

/**
* Get null datetime value.
Expand All @@ -38,7 +38,7 @@ public interface Datetimerfc1123Operations {
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall getNullAsync(final ServiceCallback<DateTimeRfc1123> serviceCallback) throws IllegalArgumentException;
ServiceCall getNullAsync(final ServiceCallback<DateTime> serviceCallback) throws IllegalArgumentException;

/**
* Get invalid datetime value.
Expand All @@ -47,7 +47,7 @@ public interface Datetimerfc1123Operations {
* @throws IOException exception thrown from serialization/deserialization
* @return the DateTimeRfc1123 object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<DateTimeRfc1123> getInvalid() throws ErrorException, IOException;
ServiceResponse<DateTime> getInvalid() throws ErrorException, IOException;

/**
* Get invalid datetime value.
Expand All @@ -56,7 +56,7 @@ public interface Datetimerfc1123Operations {
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall getInvalidAsync(final ServiceCallback<DateTimeRfc1123> serviceCallback) throws IllegalArgumentException;
ServiceCall getInvalidAsync(final ServiceCallback<DateTime> serviceCallback) throws IllegalArgumentException;

/**
* Get overflow datetime value.
Expand All @@ -65,7 +65,7 @@ public interface Datetimerfc1123Operations {
* @throws IOException exception thrown from serialization/deserialization
* @return the DateTimeRfc1123 object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<DateTimeRfc1123> getOverflow() throws ErrorException, IOException;
ServiceResponse<DateTime> getOverflow() throws ErrorException, IOException;

/**
* Get overflow datetime value.
Expand All @@ -74,7 +74,7 @@ public interface Datetimerfc1123Operations {
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall getOverflowAsync(final ServiceCallback<DateTimeRfc1123> serviceCallback) throws IllegalArgumentException;
ServiceCall getOverflowAsync(final ServiceCallback<DateTime> serviceCallback) throws IllegalArgumentException;

/**
* Get underflow datetime value.
Expand All @@ -83,7 +83,7 @@ public interface Datetimerfc1123Operations {
* @throws IOException exception thrown from serialization/deserialization
* @return the DateTimeRfc1123 object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<DateTimeRfc1123> getUnderflow() throws ErrorException, IOException;
ServiceResponse<DateTime> getUnderflow() throws ErrorException, IOException;

/**
* Get underflow datetime value.
Expand All @@ -92,7 +92,7 @@ public interface Datetimerfc1123Operations {
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall getUnderflowAsync(final ServiceCallback<DateTimeRfc1123> serviceCallback) throws IllegalArgumentException;
ServiceCall getUnderflowAsync(final ServiceCallback<DateTime> serviceCallback) throws IllegalArgumentException;

/**
* Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT.
Expand All @@ -103,7 +103,7 @@ public interface Datetimerfc1123Operations {
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> putUtcMaxDateTime(DateTimeRfc1123 datetimeBody) throws ErrorException, IOException, IllegalArgumentException;
ServiceResponse<Void> putUtcMaxDateTime(DateTime datetimeBody) throws ErrorException, IOException, IllegalArgumentException;

/**
* Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT.
Expand All @@ -113,7 +113,7 @@ public interface Datetimerfc1123Operations {
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall putUtcMaxDateTimeAsync(DateTimeRfc1123 datetimeBody, final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException;
ServiceCall putUtcMaxDateTimeAsync(DateTime datetimeBody, final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException;

/**
* Get max datetime value fri, 31 dec 9999 23:59:59 gmt.
Expand All @@ -122,7 +122,7 @@ public interface Datetimerfc1123Operations {
* @throws IOException exception thrown from serialization/deserialization
* @return the DateTimeRfc1123 object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<DateTimeRfc1123> getUtcLowercaseMaxDateTime() throws ErrorException, IOException;
ServiceResponse<DateTime> getUtcLowercaseMaxDateTime() throws ErrorException, IOException;

/**
* Get max datetime value fri, 31 dec 9999 23:59:59 gmt.
Expand All @@ -131,7 +131,7 @@ public interface Datetimerfc1123Operations {
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall getUtcLowercaseMaxDateTimeAsync(final ServiceCallback<DateTimeRfc1123> serviceCallback) throws IllegalArgumentException;
ServiceCall getUtcLowercaseMaxDateTimeAsync(final ServiceCallback<DateTime> serviceCallback) throws IllegalArgumentException;

/**
* Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT.
Expand All @@ -140,7 +140,7 @@ public interface Datetimerfc1123Operations {
* @throws IOException exception thrown from serialization/deserialization
* @return the DateTimeRfc1123 object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<DateTimeRfc1123> getUtcUppercaseMaxDateTime() throws ErrorException, IOException;
ServiceResponse<DateTime> getUtcUppercaseMaxDateTime() throws ErrorException, IOException;

/**
* Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT.
Expand All @@ -149,7 +149,7 @@ public interface Datetimerfc1123Operations {
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall getUtcUppercaseMaxDateTimeAsync(final ServiceCallback<DateTimeRfc1123> serviceCallback) throws IllegalArgumentException;
ServiceCall getUtcUppercaseMaxDateTimeAsync(final ServiceCallback<DateTime> serviceCallback) throws IllegalArgumentException;

/**
* Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT.
Expand All @@ -160,7 +160,7 @@ public interface Datetimerfc1123Operations {
* @throws IllegalArgumentException exception thrown from invalid parameters
* @return the {@link ServiceResponse} object if successful.
*/
ServiceResponse<Void> putUtcMinDateTime(DateTimeRfc1123 datetimeBody) throws ErrorException, IOException, IllegalArgumentException;
ServiceResponse<Void> putUtcMinDateTime(DateTime datetimeBody) throws ErrorException, IOException, IllegalArgumentException;

/**
* Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT.
Expand All @@ -170,7 +170,7 @@ public interface Datetimerfc1123Operations {
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall putUtcMinDateTimeAsync(DateTimeRfc1123 datetimeBody, final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException;
ServiceCall putUtcMinDateTimeAsync(DateTime datetimeBody, final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException;

/**
* Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT.
Expand All @@ -179,7 +179,7 @@ public interface Datetimerfc1123Operations {
* @throws IOException exception thrown from serialization/deserialization
* @return the DateTimeRfc1123 object wrapped in {@link ServiceResponse} if successful.
*/
ServiceResponse<DateTimeRfc1123> getUtcMinDateTime() throws ErrorException, IOException;
ServiceResponse<DateTime> getUtcMinDateTime() throws ErrorException, IOException;

/**
* Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT.
Expand All @@ -188,6 +188,6 @@ public interface Datetimerfc1123Operations {
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/
ServiceCall getUtcMinDateTimeAsync(final ServiceCallback<DateTimeRfc1123> serviceCallback) throws IllegalArgumentException;
ServiceCall getUtcMinDateTimeAsync(final ServiceCallback<DateTime> serviceCallback) throws IllegalArgumentException;

}
Loading

0 comments on commit 081e7f6

Please sign in to comment.