All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlin.validations_2.mustache Maven / Gradle / Ivy

There is a newer version: 0.118
Show newest version
{{#type}}{{#EMAIL}}{{&indent}}        require(JSONValidation.isEmail({{&kotlinName}})) { "{{&displayName}} does not match format email - ${{&kotlinName}}" }
{{/EMAIL}}{{#HOSTNAME}}{{&indent}}        require(JSONValidation.isHostname({{&kotlinName}})) { "{{&displayName}} does not match format hostname - ${{&kotlinName}}" }
{{/HOSTNAME}}{{#IPV4}}{{&indent}}        require(JSONValidation.isIPV4({{&kotlinName}})) { "{{&displayName}} does not match format ipv4 - ${{&kotlinName}}" }
{{/IPV4}}{{#IPV6}}{{&indent}}        require(JSONValidation.isIPV6({{&kotlinName}})) { "{{&displayName}} does not match format ipv6 - ${{&kotlinName}}" }
{{/IPV6}}{{#DURATION}}{{&indent}}        require(JSONValidation.isDuration({{&kotlinName}})) { "{{&displayName}} does not match format duration - ${{&kotlinName}}" }
{{/DURATION}}{{#JSON_POINTER}}{{&indent}}        require(JSONValidation.isJSONPointer({{&kotlinName}})) { "{{&displayName}} does not match format json-pointer - ${{&kotlinName}}" }
{{/JSON_POINTER}}{{#RELATIVE_JSON_POINTER}}{{&indent}}        require(JSONValidation.isRelativeJSONPointer({{&kotlinName}})) { "{{&displayName}} does not match format relative-json-pointer - ${{&kotlinName}}" }
{{/RELATIVE_JSON_POINTER}}{{#PATTERN}}{{&indent}}        require({{&value.staticName}}.containsMatchIn({{&kotlinName}})) { "{{&displayName}} does not match pattern ${{&value.staticName}} - ${{&kotlinName}}" }
{{/PATTERN}}{{#MAXIMUM_INT}}{{&indent}}        require({{&kotlinName}} <= {{&value}}) { "{{&displayName}} > maximum {{&value}} - ${{&kotlinName}}" }
{{/MAXIMUM_INT}}{{#MAXIMUM_LONG}}{{&indent}}        require({{&kotlinName}} <= {{&value}}L) { "{{&displayName}} > maximum {{&value}} - ${{&kotlinName}}" }
{{/MAXIMUM_LONG}}{{#MINIMUM_INT}}{{&indent}}        require({{&kotlinName}} >= {{&value}}) { "{{&displayName}} < minimum {{&value}} - ${{&kotlinName}}" }
{{/MINIMUM_INT}}{{#MINIMUM_LONG}}{{&indent}}        require({{&kotlinName}} >= {{&value}}L) { "{{&displayName}} < minimum {{&value}} - ${{&kotlinName}}" }
{{/MINIMUM_LONG}}{{#MAXIMUM_DECIMAL}}{{&indent}}        require({{&kotlinName}} <= {{&value.staticName}}) { "{{&displayName}} > maximum {{&value.value}} - ${{&kotlinName}}" }
{{/MAXIMUM_DECIMAL}}{{#MAXIMUM_DECIMAL_ZERO}}{{&indent}}        require({{&kotlinName}} <= BigDecimal.ZERO) { "{{&displayName}} > maximum 0 - ${{&kotlinName}}" }
{{/MAXIMUM_DECIMAL_ZERO}}{{#EXCLUSIVE_MAXIMUM_DECIMAL}}{{&indent}}        require({{&kotlinName}} < {{&value.staticName}}) { "{{&displayName}} >= exclusive maximum {{&value.value}} - ${{&kotlinName}}" }
{{/EXCLUSIVE_MAXIMUM_DECIMAL}}{{#EXCLUSIVE_MAXIMUM_DECIMAL_ZERO}}{{&indent}}        require({{&kotlinName}} < BigDecimal.ZERO) { "{{&displayName}} >= exclusive maximum 0 - ${{&kotlinName}}" }
{{/EXCLUSIVE_MAXIMUM_DECIMAL_ZERO}}{{#MINIMUM_DECIMAL}}{{&indent}}        require({{&kotlinName}} >= {{&value.staticName}}) { "{{&displayName}} < minimum {{&value.value}} - ${{&kotlinName}}" }
{{/MINIMUM_DECIMAL}}{{#MINIMUM_DECIMAL_ZERO}}{{&indent}}        require({{&kotlinName}} >= BigDecimal.ZERO) { "{{&displayName}} < minimum 0 - ${{&kotlinName}}" }
{{/MINIMUM_DECIMAL_ZERO}}{{#EXCLUSIVE_MINIMUM_DECIMAL}}{{&indent}}        require({{&kotlinName}} > {{&value.staticName}}) { "{{&displayName}} <= exclusive minimum {{&value.value}} - ${{&kotlinName}}" }
{{/EXCLUSIVE_MINIMUM_DECIMAL}}{{#EXCLUSIVE_MINIMUM_DECIMAL_ZERO}}{{&indent}}        require({{&kotlinName}} > BigDecimal.ZERO) { "{{&displayName}} <= exclusive minimum 0 - ${{&kotlinName}}" }
{{/EXCLUSIVE_MINIMUM_DECIMAL_ZERO}}{{#RANGE_INT}}{{&indent}}        require({{&kotlinName}} in {{#value}}{{&first}}..{{&second}}{{/value}}) { "{{&displayName}} not in range {{#value}}{{&first}}..{{&second}}{{/value}} - ${{&kotlinName}}" }
{{/RANGE_INT}}{{#RANGE_LONG}}{{&indent}}        require({{&kotlinName}} in {{#value}}{{&first}}L..{{&second}}L{{/value}}) { "{{&displayName}} not in range {{#value}}{{&first}}..{{&second}}{{/value}} - ${{&kotlinName}}" }
{{/RANGE_LONG}}{{#MULTIPLE_INT}}{{&indent}}        require({{&kotlinName}}.rem({{&value}}) == 0) { "{{&displayName}} not a multiple of {{&value}} - ${{&kotlinName}}" }
{{/MULTIPLE_INT}}{{#MULTIPLE_LONG}}{{&indent}}        require({{&kotlinName}}.rem({{&value}}L) == 0) { "{{&displayName}} not a multiple of {{&value}} - ${{&kotlinName}}" }
{{/MULTIPLE_LONG}}{{#MULTIPLE_DECIMAL}}{{&indent}}        require({{&kotlinName}}.rem({{&value.staticName}}) == 0) { "{{&displayName}} not a multiple of {{&value.value}} - ${{&kotlinName}}" }
{{/MULTIPLE_DECIMAL}}{{#MAX_ITEMS}}{{&indent}}        require({{&kotlinName}}.size <= {{&value}}) { "{{&displayName}} length > maximum {{&value}} - ${{&openBrace}}{{&kotlinName}}.size}" }
{{/MAX_ITEMS}}{{#MIN_ITEMS}}{{&indent}}        require({{&kotlinName}}.{{#value}}{{#isOne}}isNotEmpty(){{/isOne}}{{^isOne}}size >= {{&rawNumber}}{{/isOne}}{{/value}}) { "{{&displayName}} length < minimum {{&value}} - ${{&openBrace}}{{&kotlinName}}.size}" }
{{/MIN_ITEMS}}{{#CONST_ITEMS}}{{&indent}}        require({{&kotlinName}}.size == {{&value}}) { "{{&displayName}} length not constant value {{&value}} - ${{&openBrace}}{{&kotlinName}}.size}" }
{{/CONST_ITEMS}}{{#RANGE_ITEMS}}{{&indent}}        require({{&kotlinName}}.size in {{#value}}{{&first}}..{{&second}}{{/value}}) { "{{&displayName}} length not in range {{#value}}{{&first}}..{{&second}}{{/value}} - ${{&openBrace}}{{&kotlinName}}.size}" }
{{/RANGE_ITEMS}}{{#MAX_LENGTH}}{{&indent}}        require({{&kotlinName}}.length <= {{&value}}) { "{{&displayName}} length > maximum {{&value}} - ${{&openBrace}}{{&kotlinName}}.length}" }
{{/MAX_LENGTH}}{{#MIN_LENGTH}}{{&indent}}        require({{&kotlinName}}.{{#value}}{{#isOne}}isNotEmpty(){{/isOne}}{{^isOne}}length >= {{&rawNumber}}{{/isOne}}{{/value}}) { "{{&displayName}} length < minimum {{&value}} - ${{&openBrace}}{{&kotlinName}}.length}" }
{{/MIN_LENGTH}}{{#CONST_LENGTH}}{{&indent}}        require({{&kotlinName}}.{{#value}}length == {{&rawNumber}}{{/value}}) { "{{&displayName}} length != constant {{&value}} - ${{&openBrace}}{{&kotlinName}}.length}" }
{{/CONST_LENGTH}}{{#RANGE_LENGTH}}{{&indent}}        require({{&kotlinName}}.{{#value}}length in {{&first}}..{{&second}}{{/value}}) { "{{&displayName}} length not in range {{#value}}{{&first}}..{{&second}}{{/value}} - ${{&openBrace}}{{&kotlinName}}.length}" }
{{/RANGE_LENGTH}}{{#CONST_STRING}}{{&indent}}        require({{&kotlinName}} == {{&value.staticName}}) { "{{&displayName}} not constant value ${{&value.staticName}} - ${{&kotlinName}}" }
{{/CONST_STRING}}{{#CONST_INT}}{{&indent}}        require({{&kotlinName}} == {{&value}}) { "{{&displayName}} not constant value {{&value}} - ${{&kotlinName}}" }
{{/CONST_INT}}{{#CONST_LONG}}{{&indent}}        require({{&kotlinName}} == {{&value}}L) { "{{&displayName}} not constant value {{&value}} - ${{&kotlinName}}" }
{{/CONST_LONG}}{{#CONST_DECIMAL}}{{&indent}}        require({{&kotlinName}}.compareTo({{&value.staticName}}) == 0) { "{{&displayName}} not constant value {{&value.value}} - ${{&kotlinName}}" }
{{/CONST_DECIMAL}}{{#CONST_DECIMAL_ZERO}}{{&indent}}        require({{&kotlinName}}.compareTo(BigDecimal.ZERO) == 0) { "{{&displayName}} not constant value 0 - ${{&kotlinName}}" }
{{/CONST_DECIMAL_ZERO}}{{#ENUM_STRING}}{{&indent}}        require({{&kotlinName}} in {{&value.staticName}}) { "{{&displayName}} not in enumerated values - ${{&kotlinName}}" }
{{/ENUM_STRING}}{{#ENUM_INT}}{{&indent}}        require({{&kotlinName}} in {{&value.staticName}}) { "{{&displayName}} not in enumerated values - ${{&kotlinName}}" }
{{/ENUM_INT}}{{#ARRAY_ITEMS}}{{&indent}}        for ({{&arrayItems.kotlinName}} in {{&kotlinName}}){{#arrayItems}}{{#indent.increment}}{{#validations}}{{!
}}{{#first}}{{^last}} {{&openBrace}}{{/last}}
{{#nullable}}{{&indent}}        if ({{&kotlinName}} != null){{^last}} {{&openBrace}}{{/last}}
{{#indent.increment}}{{>validations_2}}{{/indent.increment}}{{/nullable}}{{!
}}{{^nullable}}{{>validations_2}}{{/nullable}}{{/first}}{{!
}}{{^first}}{{#nullable}}{{#indent.increment}}{{>validations_2}}{{/indent.increment}}{{/nullable}}{{^nullable}}{{>validations_2}}{{/nullable}}{{!
}}{{#last}}{{#nullable}}{{&indent}}        }
{{/nullable}}{{&indent}}    }
{{/last}}{{/first}}{{/validations}}{{/indent.increment}}{{/arrayItems}}{{/ARRAY_ITEMS}}{{/type}}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy