Package com.sap.cloud.sdk.result
Class AnnotatedFieldGsonExclusionStrategy<AnnotationT extends Annotation>
java.lang.Object
com.sap.cloud.sdk.result.AnnotatedFieldGsonExclusionStrategy<AnnotationT>
- Type Parameters:
AnnotationT
- The type of the annotation to check for.
- All Implemented Interfaces:
com.google.gson.ExclusionStrategy
public class AnnotatedFieldGsonExclusionStrategy<AnnotationT extends Annotation>
extends Object
implements com.google.gson.ExclusionStrategy
Implementation of GSON
ExclusionStrategy
excluding all fields not annotated with the given
annotation.
Typical use-case is the usage of an annotation like ElementName
. JSON should only (de-)serialize fields
annotated with this annotation and ignore every other field.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
shouldSkipClass
(Class<?> cls) boolean
shouldSkipField
(com.google.gson.FieldAttributes fieldAttributes)
-
Constructor Details
-
AnnotatedFieldGsonExclusionStrategy
-
-
Method Details
-
shouldSkipField
public boolean shouldSkipField(@Nonnull com.google.gson.FieldAttributes fieldAttributes) - Specified by:
shouldSkipField
in interfacecom.google.gson.ExclusionStrategy
-
shouldSkipClass
- Specified by:
shouldSkipClass
in interfacecom.google.gson.ExclusionStrategy
-