Class AbstractEnumValueConfigurationValidator

    • Field Detail

      • HEX_WEBCOLOR_PATTERN

        protected static final java.lang.String HEX_WEBCOLOR_PATTERN
        See Also:
        Constant Field Values
      • hexWebColorPattern

        protected static final java.util.regex.Pattern hexWebColorPattern
    • Constructor Detail

      • AbstractEnumValueConfigurationValidator

        protected AbstractEnumValueConfigurationValidator()
        Constructor for AbstractEnumValueConfigurationValidator
    • Method Detail

      • validateDescription

        protected void validateDescription​(java.lang.String description)
                                    throws ValidationException
        Validate description
        Parameters:
        description - the description
        Throws:
        ValidationException - In case of a validation violation
      • validateKey

        protected void validateKey​(java.lang.String key)
                            throws ValidationException
        Validate key
        Parameters:
        key - the key
        Throws:
        ValidationException - In case of a validation violation
      • validateValidity

        protected void validateValidity​(java.time.Instant validFrom,
                                        java.time.Instant validTill)
                                 throws ValidationException
        Validate validity
        Parameters:
        validFrom - the valid from
        validTill - the valid till
        Throws:
        ValidationException - In case of a validation violation
      • checkBase

        protected java.lang.String checkBase​(java.lang.String value)
        Check if the given value is a number or not
        Parameters:
        value - the expression
        Returns:
        true if it is a number
      • getNumber

        protected java.lang.Long getNumber​(java.lang.String input)
                                    throws java.lang.NumberFormatException
        Get the number
        Parameters:
        input - the input to parse
        Returns:
        the number
        Throws:
        java.lang.NumberFormatException - in case its not a number
      • getDouble

        protected java.lang.Double getDouble​(java.lang.String input)
                                      throws java.lang.NumberFormatException
        Get the double
        Parameters:
        input - the input to parse
        Returns:
        the double
        Throws:
        java.lang.NumberFormatException - in case its not a double
      • getBoolean

        protected java.lang.Boolean getBoolean​(java.lang.String input)
                                        throws java.lang.IllegalArgumentException
        Get the boolean
        Parameters:
        input - the input to parse
        Returns:
        the boolean
        Throws:
        java.lang.IllegalArgumentException - in case its not a boolean
      • getDate

        protected java.time.LocalDate getDate​(java.lang.String input)
                                       throws java.time.format.DateTimeParseException
        Get the date
        Parameters:
        input - the input to parse
        Returns:
        the date
        Throws:
        java.time.format.DateTimeParseException - in case its not a date
      • getTime

        protected java.time.LocalTime getTime​(java.lang.String input)
                                       throws java.time.format.DateTimeParseException
        Get the time
        Parameters:
        input - the input to parse
        Returns:
        the time
        Throws:
        java.time.format.DateTimeParseException - in case its not a time
      • getTimestamp

        protected java.time.Instant getTimestamp​(java.lang.String input)
                                          throws java.time.format.DateTimeParseException
        Get the timestamp
        Parameters:
        input - the input to parse
        Returns:
        the timestamp
        Throws:
        java.time.format.DateTimeParseException - in case its not a timestamp
      • getRegExp

        protected java.lang.String getRegExp​(java.lang.String input)
                                      throws java.util.regex.PatternSyntaxException
        Get the regexp
        Parameters:
        input - the input to parse
        Returns:
        the regexp
        Throws:
        java.util.regex.PatternSyntaxException - in case its not a regexp
      • getUUID

        protected java.util.UUID getUUID​(java.lang.String input)
                                  throws java.lang.IllegalArgumentException
        Get the UUID
        Parameters:
        input - the input to parse
        Returns:
        the UUID
        Throws:
        java.lang.IllegalArgumentException - in case its not a UUID
      • getURI

        protected java.net.URI getURI​(java.lang.String input)
                               throws java.net.URISyntaxException
        Get the uri
        Parameters:
        input - the input to parse
        Returns:
        the uri
        Throws:
        java.net.URISyntaxException - in case its not a url
      • getCIDR

        protected java.lang.String getCIDR​(java.lang.String input)
                                    throws java.net.URISyntaxException
        Get the CIDR
        Parameters:
        input - the input to parse
        Returns:
        the CIDR
        Throws:
        java.net.URISyntaxException - in case its not a CIDR
      • getEmail

        protected java.lang.String getEmail​(java.lang.String input)
                                     throws java.lang.IllegalArgumentException
        Get the email
        Parameters:
        input - the input to parse
        Returns:
        the email
        Throws:
        java.lang.IllegalArgumentException - in case its not a email
      • getCron

        protected java.lang.String getCron​(java.lang.String input)
                                    throws java.lang.IllegalArgumentException
        Get the cron
        Parameters:
        input - the input to parse
        Returns:
        the cron expression
        Throws:
        java.lang.IllegalArgumentException - in case its not a cron expression
      • getColor

        protected java.lang.String getColor​(java.lang.String input)
                                     throws java.lang.IllegalArgumentException
        Get the color
        Parameters:
        input - the input to parse
        Returns:
        the color
        Throws:
        java.lang.IllegalArgumentException - in case its not a color
      • getCertificate

        protected java.lang.String getCertificate​(java.lang.String input)
                                           throws java.lang.IllegalArgumentException
        Get the certificate
        Parameters:
        input - the input to parse
        Returns:
        the certificate
        Throws:
        java.lang.IllegalArgumentException - in case its not a certificate
      • getBinary

        protected EnumValueConfigurationBinaryObject getBinary​(java.lang.String input)
                                                        throws java.lang.IllegalArgumentException
        Get the binary content. Format: [name]|[timestamp]|[mime-type]|[content base64 encoded]. The name, timestamp (as RFC 3339), mimetype are optional, only base64 content is a valid content., e.g. myfile.txt|2021-03-15T08:59:22.123Z|text/plain|VGV4dAo= or myfile.txt|||VGV4dAo= or VGV4dAo=
        Parameters:
        input - the input to parse
        Returns:
        the file
        Throws:
        java.lang.IllegalArgumentException - in case its not a file