Fix method name by making it singular.
This commit is contained in:
parent
c266097310
commit
49e7ee05fc
@ -75,7 +75,7 @@ package com.google.gson;
|
||||
* <p>For certain model classes, you may only want to serialize a field, but exclude it for
|
||||
* deserialization. To do that, you can write an {@code ExclusionStrategy} as per normal;
|
||||
* however, you would register it with the
|
||||
* {@link GsonBuilder#addDeserializationExclusionStrategies(ExclusionStrategy...)} method.
|
||||
* {@link GsonBuilder#addDeserializationExclusionStrategy(ExclusionStrategy...)} method.
|
||||
* For example:
|
||||
* <pre class="code">
|
||||
* ExclusionStrategy excludeStrings = new UserDefinedExclusionStrategy(String.class);
|
||||
|
@ -364,7 +364,7 @@ public final class GsonBuilder {
|
||||
* @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
|
||||
* @since 1.7
|
||||
*/
|
||||
public GsonBuilder addSerializationExclusionStrategies(ExclusionStrategy strategy) {
|
||||
public GsonBuilder addSerializationExclusionStrategy(ExclusionStrategy strategy) {
|
||||
serializeExclusionStrategies.add(strategy);
|
||||
return this;
|
||||
}
|
||||
@ -379,7 +379,7 @@ public final class GsonBuilder {
|
||||
* @return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
|
||||
* @since 1.7
|
||||
*/
|
||||
public GsonBuilder addDeserializationExclusionStrategies(ExclusionStrategy strategy) {
|
||||
public GsonBuilder addDeserializationExclusionStrategy(ExclusionStrategy strategy) {
|
||||
deserializeExclusionStrategies.add(strategy);
|
||||
return this;
|
||||
}
|
||||
|
@ -91,9 +91,9 @@ public class ExclusionStrategyFunctionalTest extends TestCase {
|
||||
private static Gson createGson(ExclusionStrategy exclusionStrategy, boolean serialization) {
|
||||
GsonBuilder gsonBuilder = new GsonBuilder();
|
||||
if (serialization) {
|
||||
gsonBuilder.addSerializationExclusionStrategies(exclusionStrategy);
|
||||
gsonBuilder.addSerializationExclusionStrategy(exclusionStrategy);
|
||||
} else {
|
||||
gsonBuilder.addDeserializationExclusionStrategies(exclusionStrategy);
|
||||
gsonBuilder.addDeserializationExclusionStrategy(exclusionStrategy);
|
||||
}
|
||||
return gsonBuilder
|
||||
.serializeNulls()
|
||||
|
Loading…
Reference in New Issue
Block a user