question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow ExclusionStrategy by field value.

See original GitHub issue
When implementing the ExclusionStrategy, in shouldSkip* methods we have access 
to the fields attributes but not the fields values.

Might be usefull to be able to filter based on some specific values. So the 
idea here is to enhance the ExclusionStrategy to pass not just FieldAttributes 
but also the source object itself.

Original issue reported on code.google.com by jean-m...@spaggiari.org on 3 Jul 2012 at 6:30

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
bentathamcommented, Apr 28, 2016

+1. I would be great to shrink the JSON and parsing time by having a default value that does not need to be serialized at all, and the parsing code knows what the value is.

0reactions
GoogleCodeExportercommented, Mar 19, 2015
To me (nearly) two years of silence sound loud and clear.

I guess the project owners are busy elsewhere and Gson works good enough for 
them. There isn't much happening here in general.

Original comment by Maaarti...@gmail.com on 13 May 2014 at 3:23

Read more comments on GitHub >

github_iconTop Results From Across the Web

Excluding certain fields from Serialization based on value in ...
The way to achieve this is by creating custom serializer for the class in question. After allowing Gson to create a JSON object...
Read more >
Exclusion on Value. (Kind of ExclusionStrategy)
Hi, With the interface ExclusionStrategy it's possible to exclude a field to be serialized based on it's title. But is there a way...
Read more >
Exclude Fields from Serialization in Gson - Baeldung
ExclusionStrategy. It allows us to define (externally or with an Anonimous Inner Class) a strategy to instruct the GsonBuilder whether to ...
Read more >
Gson Builder — Exclusion Strategies - Future Studio
Gson calls them ExclusionStrategies . Of course, you have to set them via GsonBuilder . Before we go to the specific implementation, let's...
Read more >
ExclusionStrategy (Gson 2.8.2 API) - javadoc.io
A strategy (or policy) definition that is used to decide whether or not a field or top-level class should be serialized or deserialized...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found