diff --git a/gson/src/main/java/com/google/gson/ExclusionStrategy.java b/gson/src/main/java/com/google/gson/ExclusionStrategy.java index 6f78e629..3fa9c18e 100644 --- a/gson/src/main/java/com/google/gson/ExclusionStrategy.java +++ b/gson/src/main/java/com/google/gson/ExclusionStrategy.java @@ -75,7 +75,7 @@ package com.google.gson; *
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: *
* ExclusionStrategy excludeStrings = new UserDefinedExclusionStrategy(String.class); diff --git a/gson/src/main/java/com/google/gson/GsonBuilder.java b/gson/src/main/java/com/google/gson/GsonBuilder.java index c99a823b..41b6cfa4 100644 --- a/gson/src/main/java/com/google/gson/GsonBuilder.java +++ b/gson/src/main/java/com/google/gson/GsonBuilder.java @@ -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; } diff --git a/gson/src/test/java/com/google/gson/functional/ExclusionStrategyFunctionalTest.java b/gson/src/test/java/com/google/gson/functional/ExclusionStrategyFunctionalTest.java index 4ceadeb7..e5a1b858 100644 --- a/gson/src/test/java/com/google/gson/functional/ExclusionStrategyFunctionalTest.java +++ b/gson/src/test/java/com/google/gson/functional/ExclusionStrategyFunctionalTest.java @@ -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()