|
8 | 8 | import java.util.Set; |
9 | 9 |
|
10 | 10 | public class Annotation { |
| 11 | + private static final String CLIENTCORE_PACKAGE = "io.clientcore.core.http.annotation"; |
11 | 12 |
|
12 | | - public static final Annotation GENERATED = new Annotation.Builder() |
13 | | - .knownClass(com.azure.core.annotation.Generated.class) |
14 | | - .build(); |
| 13 | + public static final Annotation GENERATED = new Annotation.Builder().knownClass( |
| 14 | + com.azure.core.annotation.Generated.class).build(); |
15 | 15 |
|
16 | | - public static final Annotation HOST = new Annotation.Builder() |
17 | | - .knownClass(com.azure.core.annotation.Host.class) |
18 | | - .build(); |
| 16 | + public static final Annotation HOST = new Annotation.Builder().knownClass(com.azure.core.annotation.Host.class) |
| 17 | + .build(); |
19 | 18 |
|
20 | | - public static final Annotation SERVICE_INTERFACE = new Annotation.Builder() |
21 | | - .knownClass(com.azure.core.annotation.ServiceInterface.class) |
22 | | - .build(); |
| 19 | + public static final Annotation SERVICE_INTERFACE = new Annotation.Builder().knownClass( |
| 20 | + com.azure.core.annotation.ServiceInterface.class).build(); |
23 | 21 |
|
24 | | - public static final Annotation SERVICE_CLIENT = new Annotation.Builder() |
25 | | - .knownClass(com.azure.core.annotation.ServiceClient.class) |
26 | | - .build(); |
| 22 | + public static final Annotation SERVICE_CLIENT = new Annotation.Builder().knownClass( |
| 23 | + com.azure.core.annotation.ServiceClient.class).build(); |
27 | 24 |
|
28 | | - public static final Annotation SERVICE_METHOD = new Annotation.Builder() |
29 | | - .knownClass(com.azure.core.annotation.ServiceMethod.class) |
30 | | - .build(); |
| 25 | + public static final Annotation SERVICE_METHOD = new Annotation.Builder().knownClass( |
| 26 | + com.azure.core.annotation.ServiceMethod.class).build(); |
31 | 27 |
|
32 | | - public static final Annotation SERVICE_CLIENT_BUILDER = new Annotation.Builder() |
33 | | - .knownClass(com.azure.core.annotation.ServiceClientBuilder.class) |
34 | | - .build(); |
| 28 | + public static final Annotation SERVICE_CLIENT_BUILDER = new Annotation.Builder().knownClass( |
| 29 | + com.azure.core.annotation.ServiceClientBuilder.class).build(); |
35 | 30 |
|
36 | | - public static final Annotation UNEXPECTED_RESPONSE_EXCEPTION_TYPE = new Annotation.Builder() |
37 | | - .knownClass(com.azure.core.annotation.UnexpectedResponseExceptionType.class) |
38 | | - .build(); |
| 31 | + public static final Annotation UNEXPECTED_RESPONSE_EXCEPTION_TYPE = new Annotation.Builder().knownClass( |
| 32 | + com.azure.core.annotation.UnexpectedResponseExceptionType.class).build(); |
39 | 33 |
|
40 | | - public static final Annotation EXPECTED_RESPONSE = new Annotation.Builder() |
41 | | - .knownClass(com.azure.core.annotation.ExpectedResponses.class) |
42 | | - .build(); |
| 34 | + public static final Annotation EXPECTED_RESPONSE = new Annotation.Builder().knownClass( |
| 35 | + com.azure.core.annotation.ExpectedResponses.class).build(); |
43 | 36 |
|
44 | | - public static final Annotation HEADERS = new Annotation.Builder() |
45 | | - .knownClass(com.azure.core.annotation.Headers.class) |
46 | | - .build(); |
| 37 | + public static final Annotation HEADERS = new Annotation.Builder().knownClass( |
| 38 | + com.azure.core.annotation.Headers.class).build(); |
47 | 39 |
|
48 | | - public static final Annotation FORM_PARAM = new Annotation.Builder() |
49 | | - .knownClass(com.azure.core.annotation.FormParam.class) |
50 | | - .build(); |
| 40 | + public static final Annotation FORM_PARAM = new Annotation.Builder().knownClass( |
| 41 | + com.azure.core.annotation.FormParam.class).build(); |
51 | 42 |
|
52 | | - public static final Annotation RETURN_VALUE_WIRE_TYPE = new Annotation.Builder() |
53 | | - .knownClass(com.azure.core.annotation.ReturnValueWireType.class) |
54 | | - .build(); |
| 43 | + public static final Annotation RETURN_VALUE_WIRE_TYPE = new Annotation.Builder().knownClass( |
| 44 | + com.azure.core.annotation.ReturnValueWireType.class).build(); |
55 | 45 |
|
56 | | - public static final Annotation RETURN_TYPE = new Annotation.Builder() |
57 | | - .knownClass(com.azure.core.annotation.ReturnType.class) |
58 | | - .build(); |
| 46 | + public static final Annotation RETURN_TYPE = new Annotation.Builder().knownClass( |
| 47 | + com.azure.core.annotation.ReturnType.class).build(); |
59 | 48 |
|
60 | | - public static final Annotation IMMUTABLE = new Annotation.Builder() |
61 | | - .knownClass(com.azure.core.annotation.Immutable.class) |
62 | | - .build(); |
| 49 | + public static final Annotation IMMUTABLE = new Annotation.Builder().knownClass( |
| 50 | + com.azure.core.annotation.Immutable.class).build(); |
63 | 51 |
|
64 | | - public static final Annotation FLUENT = new Annotation.Builder() |
65 | | - .knownClass(com.azure.core.annotation.Fluent.class) |
66 | | - .build(); |
| 52 | + public static final Annotation FLUENT = new Annotation.Builder().knownClass(com.azure.core.annotation.Fluent.class) |
| 53 | + .build(); |
67 | 54 |
|
68 | | - public static final Annotation HEADER_COLLECTION = new Annotation.Builder() |
69 | | - .knownClass(com.azure.core.annotation.HeaderCollection.class) |
70 | | - .build(); |
| 55 | + public static final Annotation HEADER_COLLECTION = new Annotation.Builder().knownClass( |
| 56 | + com.azure.core.annotation.HeaderCollection.class).build(); |
71 | 57 |
|
72 | 58 | public static final Annotation METADATA = new Annotation("io.clientcore.core.annotation", "Metadata"); |
73 | 59 |
|
74 | | - public static final Annotation HTTP_REQUEST_INFORMATION |
75 | | - = new Annotation("com.generic.core.http.annotation", "HttpRequestInformation"); |
76 | | - public static final Annotation UNEXPECTED_RESPONSE_EXCEPTION_INFORMATION |
77 | | - = new Annotation("com.generic.core.http.annotation", "UnexpectedResponseExceptionDetail"); |
78 | | - public static final Annotation TYPE_CONDITIONS = new Annotation("com.generic.core.annotation", "TypeConditions"); |
| 60 | + public static final Annotation HTTP_REQUEST_INFORMATION = new Annotation(CLIENTCORE_PACKAGE, |
| 61 | + "HttpRequestInformation"); |
| 62 | + public static final Annotation UNEXPECTED_RESPONSE_EXCEPTION_INFORMATION = new Annotation(CLIENTCORE_PACKAGE, |
| 63 | + "UnexpectedResponseExceptionDetail"); |
| 64 | + public static final Annotation TYPE_CONDITIONS = new Annotation(CLIENTCORE_PACKAGE, "TypeConditions"); |
79 | 65 |
|
80 | 66 | private final String fullName; |
81 | 67 | private final String packageName; |
@@ -115,13 +101,13 @@ public Builder name(String name) { |
115 | 101 | } |
116 | 102 |
|
117 | 103 | public Builder knownClass(Class<?> clazz) { |
118 | | - this.packageName(clazz.getPackage().getName()) |
119 | | - .name(clazz.getSimpleName()); |
| 104 | + this.packageName(clazz.getPackage().getName()).name(clazz.getSimpleName()); |
120 | 105 |
|
121 | 106 | if (!JavaSettings.getInstance().isBranded()) { |
122 | | - this.packageName(clazz.getPackage().getName() |
123 | | - .replace(ExternalPackage.AZURE_CORE_PACKAGE_NAME, ExternalPackage.GENERIC_CORE_PACKAGE_NAME) |
124 | | - .replace(ExternalPackage.AZURE_JSON_PACKAGE_NAME, ExternalPackage.GENERIC_JSON_PACKAGE_NAME)); |
| 107 | + this.packageName(clazz.getPackage() |
| 108 | + .getName() |
| 109 | + .replace(ExternalPackage.AZURE_CORE_PACKAGE_NAME, ExternalPackage.CLIENTCORE_PACKAGE_NAME) |
| 110 | + .replace(ExternalPackage.AZURE_JSON_PACKAGE_NAME, ExternalPackage.CLIENTCORE_JSON_PACKAGE_NAME)); |
125 | 111 | } |
126 | 112 |
|
127 | 113 | return this; |
|
0 commit comments