1 | package com.fwmotion.threescale.cms.mixins; | |
2 | ||
3 | import com.fasterxml.jackson.core.JsonGenerator; | |
4 | import com.fasterxml.jackson.databind.SerializerProvider; | |
5 | import com.fasterxml.jackson.databind.ser.std.StdSerializer; | |
6 | import com.redhat.threescale.rest.cms.model.EnumHandler; | |
7 | import jakarta.annotation.Nonnull; | |
8 | import jakarta.annotation.Nullable; | |
9 | ||
10 | import java.io.IOException; | |
11 | ||
12 | public class EnumHandlerSerializer extends StdSerializer<EnumHandler> { | |
13 | ||
14 | public EnumHandlerSerializer() { | |
15 | this(EnumHandler.class); | |
16 | } | |
17 | ||
18 | protected EnumHandlerSerializer(@Nonnull Class<EnumHandler> t) { | |
19 | super(t); | |
20 | } | |
21 | ||
22 | @Override | |
23 | public void serialize(@Nullable EnumHandler value, | |
24 | @Nonnull JsonGenerator gen, | |
25 | @Nullable SerializerProvider provider) throws IOException { | |
26 |
4
1. serialize : removed conditional - replaced equality check with true → KILLED 2. serialize : removed conditional - replaced equality check with false → KILLED 3. serialize : removed conditional - replaced equality check with false → KILLED 4. serialize : removed conditional - replaced equality check with true → KILLED |
if (value == null |
27 | || value == EnumHandler.UNKNOWN_DEFAULT_OPEN_API) { | |
28 |
1
1. serialize : removed call to com/fasterxml/jackson/core/JsonGenerator::writeNull → KILLED |
gen.writeNull(); |
29 | } else { | |
30 |
1
1. serialize : removed call to com/fasterxml/jackson/core/JsonGenerator::writeString → KILLED |
gen.writeString(value.getValue()); |
31 | } | |
32 | } | |
33 | } | |
Mutations | ||
26 |
1.1 2.2 3.3 4.4 |
|
28 |
1.1 |
|
30 |
1.1 |