Class EnumSetSerializer

java.lang.Object
com.microsoft.graph.serializer.EnumSetSerializer

public class EnumSetSerializer extends Object
Serializes and deserializes EnumSets The Graph service expects a single enum value as a comma-delimited string Here, we flatten the EnumSet to serialize the object and insert the response into an array to deserialize back to an EnumSet
  • Constructor Details

    • EnumSetSerializer

      public EnumSetSerializer(@Nonnull ILogger logger)
      Not available for instantiation
      Parameters:
      logger - logger to use during serialization
  • Method Details

    • deserialize

      @Nullable public EnumSet<?> deserialize(@Nonnull Type type, @Nonnull String jsonStrToDeserialize)
      Deserializes a comma-delimited string of enum values
      Parameters:
      type - the type
      jsonStrToDeserialize - the string to deserialize
      Returns:
      EnumSet of values
    • serialize

      @Nullable public com.google.gson.JsonPrimitive serialize(@Nonnull EnumSet<?> src)
      Serializes an EnumSet into a comma-delimited string
      Parameters:
      src - the source EnumSet
      Returns:
      a comma-delimited string of enum values