| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| Method |
|
| 0.0;0 |
| 1 | /* | |
| 2 | * Copyright 2003-2008 the original author or authors. | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | * | |
| 16 | * You are receiving this code free of charge, which represents many hours of | |
| 17 | * effort from other individuals and corporations. As a responsible member | |
| 18 | * of the community, you are asked (but not required) to donate any | |
| 19 | * enhancements or improvements back to the community under a similar open | |
| 20 | * source license. Thank you. -TMN | |
| 21 | */ | |
| 22 | package groovyx.net.http; | |
| 23 | ||
| 24 | import org.apache.http.client.methods.HttpDelete; | |
| 25 | import org.apache.http.client.methods.HttpGet; | |
| 26 | import org.apache.http.client.methods.HttpHead; | |
| 27 | import org.apache.http.client.methods.HttpPost; | |
| 28 | import org.apache.http.client.methods.HttpPut; | |
| 29 | import org.apache.http.client.methods.HttpRequestBase; | |
| 30 | ||
| 31 | 1 | public enum Method { |
| 32 | 1 | GET( HttpGet.class ), |
| 33 | 1 | PUT( HttpPut.class ), |
| 34 | 1 | POST( HttpPost.class ), |
| 35 | 1 | DELETE( HttpDelete.class ), |
| 36 | 1 | HEAD( HttpHead.class ); |
| 37 | ||
| 38 | private final Class<? extends HttpRequestBase> requestType; | |
| 39 | 3 | public Class<? extends HttpRequestBase> getRequestType() { return this.requestType; } |
| 40 | ||
| 41 | 5 | private Method( Class<? extends HttpRequestBase> type ) { |
| 42 | 5 | this.requestType = type; |
| 43 | 5 | } |
| 44 | } |