Class ObfuscatorProperties

java.lang.Object
com.github.robtimus.obfuscation.spring.boot.autoconfigure.ObfuscatorProperties

@Validated @ValidObfuscatorProperties public class ObfuscatorProperties extends Object
Properties for Obfuscators.
Author:
Rob Spoor
  • Constructor Details

    • ObfuscatorProperties

      public ObfuscatorProperties()
  • Method Details

    • getMode

    • setMode

      public void setMode(ObfuscatorProperties.ObfuscationMode mode)
    • getMaskChar

      public Character getMaskChar()
    • setMaskChar

      public void setMaskChar(Character maskChar)
    • getFixedLength

      public Integer getFixedLength()
    • setFixedLength

      public void setFixedLength(Integer fixedLength)
    • getFixedValue

      public String getFixedValue()
    • setFixedValue

      public void setFixedValue(String fixedValue)
    • getKeepAtStart

      public Integer getKeepAtStart()
    • setKeepAtStart

      public void setKeepAtStart(Integer keepAtStart)
    • getKeepAtEnd

      public Integer getKeepAtEnd()
    • setKeepAtEnd

      public void setKeepAtEnd(Integer keepAtEnd)
    • getAtLeastFromStart

      public Integer getAtLeastFromStart()
    • setAtLeastFromStart

      public void setAtLeastFromStart(Integer atLeastFromStart)
    • getAtLeastFromEnd

      public Integer getAtLeastFromEnd()
    • setAtLeastFromEnd

      public void setAtLeastFromEnd(Integer atLeastFromEnd)
    • getFixedTotalLength

      public Integer getFixedTotalLength()
    • setFixedTotalLength

      public void setFixedTotalLength(Integer fixedTotalLength)
    • getProviderClass

      public Class<? extends ObfuscatorProvider> getProviderClass()
    • setProviderClass

      public void setProviderClass(Class<? extends ObfuscatorProvider> providerClass)
    • createObfuscator

      public Obfuscator createObfuscator(AutowireCapableBeanFactory beanFactory)
      Creates an obfuscator based on the properties configured in this object.
      Parameters:
      beanFactory - A bean factory to use to create instances of ObfuscatorProvider if needed.
      Returns:
      The created obfuscator.
      Throws:
      NullPointerException - If the given bean factory is null.
      IllegalStateException - If this object is in an inconsistent state.
    • createObfuscator

      public Obfuscator createObfuscator(ObjectFactory objectFactory)
      Creates an obfuscator based on the properties configured in this object.
      Parameters:
      objectFactory - The object factory to use to create instances of ObfuscatorProvider if needed.
      Returns:
      The created obfuscator.
      Throws:
      NullPointerException - If the given object factory is null.
      IllegalStateException - If this object is in an inconsistent state.
    • createObfuscators

      public static List<Obfuscator> createObfuscators(Collection<ObfuscatorProperties> properties, AutowireCapableBeanFactory beanFactory)
      Creates obfuscators based on the properties configured in multiple properties objects.
      Parameters:
      properties - A collection of properties objects for which to create obfuscators.
      beanFactory - A bean factory to use to create instances of ObfuscatorProvider if needed.
      Returns:
      The created obfuscators.
      Throws:
      NullPointerException - If the given collection, any of its elements, or the given bean factory is null.
      IllegalStateException - If any of the properties objects is in an inconsistent state.
    • createObfuscators

      public static List<Obfuscator> createObfuscators(Collection<ObfuscatorProperties> properties, ObjectFactory objectFactory)
      Creates obfuscators based on the properties configured in multiple properties objects.
      Parameters:
      properties - A collection of properties objects for which to create obfuscators.
      objectFactory - The object factory to use to create instances of ObfuscatorProvider if needed.
      Returns:
      The created obfuscators.
      Throws:
      NullPointerException - If the given collection, any of its elements, or the given bean factory is null.
      IllegalStateException - If any of the properties objects is in an inconsistent state.
    • createObfuscators

      public static <K> Map<K,Obfuscator> createObfuscators(Map<? extends K,ObfuscatorProperties> properties, AutowireCapableBeanFactory beanFactory)
      Creates obfuscators based on the properties configured in multiple properties objects.
      Type Parameters:
      K - The map key type.
      Parameters:
      properties - A map with properties objects for which to create obfuscators.
      beanFactory - A bean factory to use to create instances of ObfuscatorProvider if needed.
      Returns:
      The created obfuscators.
      Throws:
      NullPointerException - If the given map, any of its values, or the given bean factory is null.
      IllegalStateException - If any of the properties objects is in an inconsistent state.
      Since:
      2.2
    • createObfuscators

      public static <K> Map<K,Obfuscator> createObfuscators(Map<? extends K,ObfuscatorProperties> properties, ObjectFactory objectFactory)
      Creates obfuscators based on the properties configured in multiple properties objects.
      Type Parameters:
      K - The map key type.
      Parameters:
      properties - A map with properties objects for which to create obfuscators.
      objectFactory - The object factory to use to create instances of ObfuscatorProvider if needed.
      Returns:
      The created obfuscators.
      Throws:
      NullPointerException - If the given map, any of its values, or the given bean factory is null.
      IllegalStateException - If any of the properties objects is in an inconsistent state.
      Since:
      2.2