Class StringValueConverter


  • public class StringValueConverter
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ENCRYPTED_PREFIX  
      static java.lang.String PLAIN_PREFIX  
      static java.lang.String SUFFIX  
    • Constructor Summary

      Constructors 
      Constructor Description
      StringValueConverter​(com.xebialabs.deployit.util.PasswordEncrypter passwordEncrypter)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String convert​(StringValue v, boolean keepPlainAsIs)
      Convert a StringValue to its public representation.
      StringValue convert​(java.lang.String s)  
      StringValue convert​(java.lang.String s, boolean fallbackEncrypted)  
      static java.util.function.Function<java.lang.String,​StringValue> stringToValue​(com.xebialabs.deployit.util.PasswordEncrypter passwordEncrypter)  
      static java.util.function.Function<StringValue,​java.lang.String> valueToString​(com.xebialabs.deployit.util.PasswordEncrypter passwordEncrypter)  
      static java.util.function.Function<StringValue,​java.lang.String> valueToString​(com.xebialabs.deployit.util.PasswordEncrypter passwordEncrypter, boolean fallbackEncrypted)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringValueConverter

        public StringValueConverter​(com.xebialabs.deployit.util.PasswordEncrypter passwordEncrypter)
    • Method Detail

      • valueToString

        public static final java.util.function.Function<StringValue,​java.lang.String> valueToString​(com.xebialabs.deployit.util.PasswordEncrypter passwordEncrypter)
      • valueToString

        public static final java.util.function.Function<StringValue,​java.lang.String> valueToString​(com.xebialabs.deployit.util.PasswordEncrypter passwordEncrypter,
                                                                                                          boolean fallbackEncrypted)
      • stringToValue

        public static final java.util.function.Function<java.lang.String,​StringValue> stringToValue​(com.xebialabs.deployit.util.PasswordEncrypter passwordEncrypter)
      • convert

        public java.lang.String convert​(StringValue v,
                                        boolean keepPlainAsIs)
        Convert a StringValue to its public representation. For an EncryptedStringValue this means that the value will be encrypted. For a plaintext StringValue it adds a prefix/suffix to the string if the boolean keepPlainAsIs is set to true, the plaintext is output as is.
        Parameters:
        v - the StringValue to convert
        keepPlainAsIs - true to keep the plainText as is, false to add a special prefix/suffix to clearly demarcate the value.
        Returns:
        The converted String.
      • convert

        public StringValue convert​(java.lang.String s)
      • convert

        public StringValue convert​(java.lang.String s,
                                   boolean fallbackEncrypted)