-
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 #809 from microsoft/bugfix/enum-queryparameters-se…
…rialization bugfix/enum queryparameters serialization
- Loading branch information
Showing
5 changed files
with
128 additions
and
8 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
24 changes: 24 additions & 0 deletions
24
components/abstractions/src/test/java/com/microsoft/kiota/serialization/mocks/TestEnum.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,24 @@ | ||
package com.microsoft.kiota.serialization.mocks; | ||
|
||
import java.util.Objects; | ||
import com.microsoft.kiota.serialization.ValuedEnum; | ||
|
||
public enum TestEnum implements ValuedEnum { | ||
First("1"), | ||
Second("2"); | ||
public final String value; | ||
TestEnum(final String value) { | ||
this.value = value; | ||
} | ||
@jakarta.annotation.Nonnull | ||
public String getValue() { return this.value; } | ||
@jakarta.annotation.Nullable | ||
public static TestEnum forValue(@jakarta.annotation.Nonnull final String searchValue) { | ||
Objects.requireNonNull(searchValue); | ||
switch(searchValue) { | ||
case "1": return First; | ||
case "2": return Second; | ||
default: return null; | ||
} | ||
} | ||
} |
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