• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package software.amazon.awssdk.services.jsonprotocoltests.model;
2 
3 import java.util.EnumSet;
4 import java.util.Map;
5 import java.util.Set;
6 import software.amazon.awssdk.annotations.Generated;
7 import software.amazon.awssdk.annotations.SdkPublicApi;
8 import software.amazon.awssdk.services.jsonprotocoltests.model.inputeventstreamtwo.DefaultInputEventTwo;
9 import software.amazon.awssdk.utils.internal.EnumUtils;
10 
11 /**
12  * Base interface for all event types in InputEventStreamTwo.
13  */
14 @Generated("software.amazon.awssdk:codegen")
15 @SdkPublicApi
16 public interface InputEventStreamTwo {
17     /**
18      * Create a builder for the {@code InputEventTwo} event type for this stream.
19      */
inputEventTwoBuilder()20     static InputEventTwo.Builder inputEventTwoBuilder() {
21         return DefaultInputEventTwo.builder();
22     }
23 
24     /**
25      * The type of this event. Corresponds to the {@code :event-type} header on the Message.
26      */
sdkEventType()27     default EventType sdkEventType() {
28         return EventType.UNKNOWN_TO_SDK_VERSION;
29     }
30 
31     /**
32      * The known possible types of events for {@code InputEventStreamTwo}.
33      */
34     @Generated("software.amazon.awssdk:codegen")
35     enum EventType {
36         INPUT_EVENT_TWO("InputEventTwo"),
37 
38         UNKNOWN_TO_SDK_VERSION(null);
39 
40         private static final Map<String, EventType> VALUE_MAP = EnumUtils.uniqueIndex(EventType.class, EventType::toString);
41 
42         private final String value;
43 
EventType(String value)44         private EventType(String value) {
45             this.value = value;
46         }
47 
48         @Override
toString()49         public String toString() {
50             return String.valueOf(value);
51         }
52 
53         /**
54          * Use this in place of valueOf to convert the raw string returned by the service into the enum value.
55          *
56          * @param value
57          *        real value
58          * @return EventType corresponding to the value
59          */
fromValue(String value)60         public static EventType fromValue(String value) {
61             if (value == null) {
62                 return null;
63             }
64             return VALUE_MAP.getOrDefault(value, UNKNOWN_TO_SDK_VERSION);
65         }
66 
67         /**
68          * Use this in place of {@link #values()} to return a {@link Set} of all values known to the SDK. This will
69          * return all known enum values except {@link #UNKNOWN_TO_SDK_VERSION}.
70          *
71          * @return a {@link Set} of known {@link EventType}s
72          */
knownValues()73         public static Set<EventType> knownValues() {
74             Set<EventType> knownValues = EnumSet.allOf(EventType.class);
75             knownValues.remove(UNKNOWN_TO_SDK_VERSION);
76             return knownValues;
77         }
78     }
79 }
80 
81