Class PropertyNameTransformer

java.lang.Object
org.springframework.cloud.vault.config.PropertyNameTransformer
All Implemented Interfaces:
org.springframework.vault.core.util.PropertyTransformer

public class PropertyNameTransformer extends Object implements org.springframework.vault.core.util.PropertyTransformer
PropertyTransformer to transform a Map of properties by applying key name translation.

Existing keys will be transformed to a target key name while retaining the original value. Key name translation will leave other, not specified key names untouched.

Author:
Mark Paluch
  • Constructor Details

  • Method Details

    • addKeyTransformation

      public void addKeyTransformation(String sourceKeyName, String targetKeyName)
      Adds a key name transformation by providing a sourceKeyName and a targetKeyName.
      Parameters:
      sourceKeyName - must not be empty or null.
      targetKeyName - must not be empty or null.
    • transformProperties

      public Map<String,Object> transformProperties(Map<String, ? extends Object> input)
      Specified by:
      transformProperties in interface org.springframework.vault.core.util.PropertyTransformer