-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #839 from andreaTP/perf-and-simplifications
Json parse improvements
- Loading branch information
Showing
5 changed files
with
114 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...ents/serialization/json/src/test/java/com/microsoft/kiota/serialization/mocks/MyEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.microsoft.kiota.serialization.mocks; | ||
|
||
import com.microsoft.kiota.serialization.ValuedEnum; | ||
import java.util.Objects; | ||
|
||
public enum MyEnum implements ValuedEnum { | ||
MY_VALUE1("VALUE1"), | ||
MY_VALUE2("VALUE2"); | ||
public final String value; | ||
|
||
MyEnum(final String value) { | ||
this.value = value; | ||
} | ||
|
||
@jakarta.annotation.Nonnull public String getValue() { | ||
return this.value; | ||
} | ||
|
||
@jakarta.annotation.Nullable public static MyEnum forValue(@jakarta.annotation.Nonnull final String searchValue) { | ||
Objects.requireNonNull(searchValue); | ||
switch (searchValue) { | ||
case "VALUE1": | ||
return MY_VALUE1; | ||
case "VALUE2": | ||
return MY_VALUE2; | ||
default: | ||
return null; | ||
} | ||
} | ||
} |
Oops, something went wrong.