Class OrderingSetSerializer

  • All Implemented Interfaces:
    com.google.gson.JsonSerializer<Set<@Nullable Object>>

    @NonNullByDefault
    public class OrderingSetSerializer
    extends Object
    implements com.google.gson.JsonSerializer<Set<@Nullable Object>>
    Serializes set by ordering the elements
    Author:
    Sami Salonen - Initial contribution
    • Constructor Detail

      • OrderingSetSerializer

        public OrderingSetSerializer()
    • Method Detail

      • allSameClassAndComparable

        public static boolean allSameClassAndComparable​(Set<@Nullable Object> src)
      • serialize

        public com.google.gson.JsonElement serialize​(Set<@Nullable Object> src,
                                                     Type typeOfSrc,
                                                     com.google.gson.JsonSerializationContext context)
        Specified by:
        serialize in interface com.google.gson.JsonSerializer<Set<@Nullable Object>>