forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use HttpMethod instead of String (Azure#342)
* Add HttpMethod class * Use HttpMethod instead of strings
- Loading branch information
Dan Schulte
authored
Jan 9, 2018
1 parent
56e004f
commit 0689b3e
Showing
23 changed files
with
190 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
client-runtime/src/main/java/com/microsoft/rest/v2/http/HttpMethod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for | ||
* license information. | ||
*/ | ||
|
||
package com.microsoft.rest.v2.http; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.microsoft.rest.v2.ExpandableStringEnum; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* The different HTTP methods of a HttpRequest. | ||
*/ | ||
public class HttpMethod extends ExpandableStringEnum<HttpMethod> { | ||
/** | ||
* The HTTP GET method. | ||
*/ | ||
public static final HttpMethod GET = fromString("GET"); | ||
|
||
/** | ||
* The HTTP PUT method. | ||
*/ | ||
public static final HttpMethod PUT = fromString("PUT"); | ||
|
||
/** | ||
* The HTTP POST method. | ||
*/ | ||
public static final HttpMethod POST = fromString("POST"); | ||
|
||
/** | ||
* The HTTP PATCH method. | ||
*/ | ||
public static final HttpMethod PATCH = fromString("PATCH"); | ||
|
||
/** | ||
* The HTTP DELETE method. | ||
*/ | ||
public static final HttpMethod DELETE = fromString("DELETE"); | ||
|
||
/** | ||
* The HTTP HEAD method. | ||
*/ | ||
public static final HttpMethod HEAD = fromString("HEAD"); | ||
|
||
/** | ||
* Creates or finds a HttpMethod from its string representation. | ||
* | ||
* @param name a name to look for. | ||
* @return the corresponding HttpMethod. | ||
*/ | ||
@JsonCreator | ||
public static HttpMethod fromString(String name) { | ||
return fromString(name, HttpMethod.class); | ||
} | ||
|
||
/** | ||
* @return known HttpMethod values. | ||
*/ | ||
public static Collection<HttpMethod> values() { | ||
return values(HttpMethod.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.