File tree Expand file tree Collapse file tree
main/java/software/amazon/awssdk/core
test/java/software/amazon/awssdk/core/useragent
http-client-spi/src/main/java/software/amazon/awssdk/http Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737import software .amazon .awssdk .core .internal .async .InputStreamWithExecutorAsyncRequestBody ;
3838import software .amazon .awssdk .core .internal .async .SplittingPublisher ;
3939import software .amazon .awssdk .core .internal .util .Mimetype ;
40- import software .amazon .awssdk .core .sync .ResponseTransformer ;
4140import software .amazon .awssdk .utils .BinaryUtils ;
4241import software .amazon .awssdk .utils .Validate ;
4342import software .amazon .awssdk .utils .internal .EnumUtils ;
@@ -541,12 +540,12 @@ enum BodyType {
541540 PUBLISHER ("Publisher" , "p" ),
542541 UNKNOWN ("Unknown" , "u" );
543542
544- private final String name ;
545- private final String shortValue ;
546-
547543 private static final Map <String , BodyType > VALUE_MAP =
548544 EnumUtils .uniqueIndex (BodyType .class , BodyType ::getName );
549545
546+ private final String name ;
547+ private final String shortValue ;
548+
550549 BodyType (String name , String shortValue ) {
551550 this .name = name ;
552551 this .shortValue = shortValue ;
Original file line number Diff line number Diff line change @@ -391,12 +391,12 @@ enum TransformerType {
391391 PUBLISHER ("Publisher" , "p" ),
392392 UNKNOWN ("Unknown" , "u" );
393393
394- private final String name ;
395- private final String shortValue ;
396-
397394 private static final Map <String , TransformerType > VALUE_MAP =
398395 EnumUtils .uniqueIndex (TransformerType .class , TransformerType ::getName );
399396
397+ private final String name ;
398+ private final String shortValue ;
399+
400400 TransformerType (String name , String shortValue ) {
401401 this .name = name ;
402402 this .shortValue = shortValue ;
Original file line number Diff line number Diff line change 3737import software .amazon .awssdk .core .internal .http .InterruptMonitor ;
3838import software .amazon .awssdk .core .retry .RetryPolicy ;
3939import software .amazon .awssdk .http .AbortableInputStream ;
40- import software .amazon .awssdk .http .ContentStreamProvider ;
4140import software .amazon .awssdk .utils .IoUtils ;
4241import software .amazon .awssdk .utils .Logger ;
4342import software .amazon .awssdk .utils .internal .EnumUtils ;
@@ -291,11 +290,12 @@ enum TransformerType {
291290 STREAM ("Stream" , "s" ),
292291 UNKNOWN ("Unknown" , "u" );
293292
293+ private static final Map <String , TransformerType > VALUE_MAP =
294+ EnumUtils .uniqueIndex (TransformerType .class , TransformerType ::getName );
295+
294296 private final String name ;
295297 private final String shortValue ;
296298
297- private static final Map <String , TransformerType > VALUE_MAP =
298- EnumUtils .uniqueIndex (TransformerType .class , TransformerType ::getName );
299299
300300 TransformerType (String name , String shortValue ) {
301301 this .name = name ;
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
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+ * A copy of the License is located at
7+ *
8+ * http://aws.amazon.com/apache2.0
9+ *
10+ * or in the "license" file accompanying this file. This file is distributed
11+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+ * express or implied. See the License for the specific language governing
13+ * permissions and limitations under the License.
14+ */
15+
16+ package software .amazon .awssdk .core .useragent ;
17+
18+ import static org .junit .jupiter .api .Assertions .assertEquals ;
19+
20+ import nl .jqno .equalsverifier .EqualsVerifier ;
21+ import org .junit .jupiter .api .Test ;
22+
23+ public class AdditionalMetadataTest {
24+
25+ @ Test
26+ public void toString_formatsCorrectly () {
27+ AdditionalMetadata metadata = AdditionalMetadata .builder ()
28+ .name ("name" )
29+ .value ("value" )
30+ .build ();
31+ assertEquals ("md/name#value" , metadata .toString ());
32+ }
33+ @ Test
34+ public void equalsHashCode () {
35+ EqualsVerifier .forClass (AdditionalMetadata .class )
36+ .withNonnullFields ("name" , "value" )
37+ .verify ();
38+ }
39+ }
40+
41+
Original file line number Diff line number Diff line change 2424import java .util .Arrays ;
2525import java .util .Map ;
2626import java .util .function .Supplier ;
27- import software .amazon .awssdk .annotations .SdkInternalApi ;
2827import software .amazon .awssdk .annotations .SdkProtectedApi ;
2928import software .amazon .awssdk .annotations .SdkPublicApi ;
3029import software .amazon .awssdk .utils .IoUtils ;
@@ -185,11 +184,12 @@ enum ProviderType {
185184 STREAM ("Stream" , "s" ),
186185 UNKNOWN ("Unknown" , "u" );
187186
187+ private static final Map <String , ProviderType > VALUE_MAP =
188+ EnumUtils .uniqueIndex (ProviderType .class , ProviderType ::getName );
189+
188190 private final String name ;
189191 private final String shortValue ;
190192
191- private static final Map <String , ProviderType > VALUE_MAP =
192- EnumUtils .uniqueIndex (ProviderType .class , ProviderType ::getName );
193193
194194 ProviderType (String name , String shortValue ) {
195195 this .name = name ;
You can’t perform that action at this time.
0 commit comments