Skip to content

Commit

Permalink
Review chages.
Browse files Browse the repository at this point in the history
Function name changed and restored to old implementation
  • Loading branch information
bipoool committed Jan 12, 2024
1 parent 6d429b8 commit 2c876e5
Showing 1 changed file with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,13 @@ public CustomConversions customConversions() {
* @return must not be {@literal null}.
*/
public CustomConversions customConversions(CryptoManager cryptoManager, ObjectMapper objectMapper) {
List<Object> newConverters = additionalConverters();
List<Object> newConverters = new ArrayList();
// The following
newConverters.add(new OtherConverters.EnumToObject(getObjectMapper()));
newConverters.add(new IntegerToEnumConverterFactory(getObjectMapper()));
newConverters.add(new StringToEnumConverterFactory(getObjectMapper()));
newConverters.add(new BooleanToEnumConverterFactory(getObjectMapper()));
additionalConverters(newConverters);
CustomConversions customConversions = CouchbaseCustomConversions.create(configurationAdapter -> {
SimplePropertyValueConversions valueConversions = new SimplePropertyValueConversions();
valueConversions.setConverterFactory(
Expand All @@ -445,31 +451,10 @@ public CustomConversions customConversions(CryptoManager cryptoManager, ObjectMa
return customConversions;
}

/**
* This function makes a list of custom converters.
* This list can be updated via {@link #registerAdditionalConverters(List)}
*
* @return additionalConverters - must not be {@literal null}.
*/
public List<Object> additionalConverters() {

List<Object> additionalConverters = new ArrayList();
additionalConverters.add(new OtherConverters.EnumToObject(getObjectMapper()));
additionalConverters.add(new IntegerToEnumConverterFactory(getObjectMapper()));
additionalConverters.add(new StringToEnumConverterFactory(getObjectMapper()));
additionalConverters.add(new BooleanToEnumConverterFactory(getObjectMapper()));

// Register more converters
registerAdditionalConverters(additionalConverters);

return additionalConverters;

}

/**
* This should be overridden in order to update the {@link #additionalConverters()} List
*/
protected void registerAdditionalConverters(List<Object> converters) {
protected void additionalConverters(List<Object> converters) {
// NO_OP
}

Expand Down

0 comments on commit 2c876e5

Please sign in to comment.