MCPcopy Index your code
hub / github.com/cloudevents/sdk-java / parse

Method parse

api/src/main/java/io/cloudevents/SpecVersion.java:75–84  ·  view source on GitHub ↗

Parse a string as SpecVersion @param sv String representing the spec version @return The parsed spec version @throws CloudEventRWException When the spec version string is unrecognized

(String sv)

Source from the content-addressed store, hash-verified

73 * @throws CloudEventRWException When the spec version string is unrecognized
74 */
75 public static SpecVersion parse(String sv) {
76 switch (sv) {
77 case "0.3":
78 return SpecVersion.V03;
79 case "1.0":
80 return SpecVersion.V1;
81 default:
82 throw CloudEventRWException.newInvalidSpecVersion(sv);
83 }
84 }
85
86 /**
87 * @return mandatory attributes of the spec version

Callers 7

deserializeMethod · 0.95
readMethod · 0.95
readMethod · 0.95
readMethod · 0.95
parseMethod · 0.95
fromMapMethod · 0.95

Calls 1

newInvalidSpecVersionMethod · 0.95

Tested by 2

deserializeMethod · 0.76
parseMethod · 0.76