google / google/gson

ExclusionStrategy

Open
#1,975 1 comment 0 reactions 0 assignees View on GitHub
enhancement needs-info
Dominant language
Java
Stars
24.2k
Forks
4.5k
Avg merge
6d 4h
Merged PRs (30d)
12

Description

Excluding a field might be dependent on whether serialization or deserialization is taking place. Would be nice to expand this interface to:

enum SerializationDirection { SERIALIZING, DESERIALIZING }

public interface ExclusionStrategy {

public boolean shouldSkipField(FieldAttributes f, SerializationDirection d);
public boolean shouldSkipClass(Class clazz, SerializationDirection d );
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.