Code example for Excluder

Methods: withExclusionStrategy

0
   * @param strategy an exclusion strategy to apply during serialization. 
   * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern 
   * @since 1.7 
   */ 
  public GsonBuilder addSerializationExclusionStrategy(ExclusionStrategy strategy) {
    excluder = excluder.withExclusionStrategy(strategy, true, false);
    return this;
  } 
 
  /** 
   * Configures Gson to apply the passed in exclusion strategy during deserialization. 
   * If this method is invoked numerous times with different exclusion strategy objects 
   * then the exclusion strategies that were added will be applied as a disjunction rule. 
   * This means that if one of the added exclusion strategies suggests that a field (or 
   * class) should be skipped then that field (or object) is skipped during its 
   * deserialization. 
   * 
   * @param strategy an exclusion strategy to apply during deserialization. 
   * @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern 
   * @since 1.7 
Contextual code suggestions in your IDE  Get Codota for Java