Class EntitySerializer

  • All Implemented Interfaces:
    com.google.gson.JsonSerializer<org.molgenis.data.Entity>

    public class EntitySerializer
    extends Object
    implements com.google.gson.JsonSerializer<org.molgenis.data.Entity>
    Serializer for concrete Entity subclasses. This allows you to return Entities in your Controllers, without having to create DTO's with explicit fields for Gson serialization.
    • Constructor Detail

      • EntitySerializer

        public EntitySerializer()
    • Method Detail

      • serialize

        public com.google.gson.JsonElement serialize​(org.molgenis.data.Entity entity,
                                                     Type type,
                                                     com.google.gson.JsonSerializationContext context)
        Specified by:
        serialize in interface com.google.gson.JsonSerializer<org.molgenis.data.Entity>