package org.zalando.nakadi.annotations.validation;

import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({
        ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE,
        ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@NotEmpty(message = "Key cannot be empty")
@Pattern(regexp = "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?[^/]*$",
        message = "Key name should be an optional lowercase domain name with path")
@Pattern(regexp = "^([-.a-z0-9]{0,253}/)?[^/]*$",
        message = "Key prefix cannot be more than 253 characters.")
@Pattern(regexp = "^([-.a-z0-9]+/)?[^/]{0,63}$",
        message = "Key name cannot be more than 63 characters.")
@Pattern(regexp = "^([^/]+/)?[a-zA-Z0-9]([a-zA-Z0-9_.-]*[a-zA-Z0-9])?$",
        message = "Key name should start with letter or digit and end with letter")
@Constraint(validatedBy = {})
public @interface LabelKey {
    String message() default "{org.zalando.nakadi.annotations.validation.LabelKey.message}}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}

@@ -118,99 +118,8 @@
 ad;%0A
-import javax.validation.constraints.NotEmpty;%0Aimport javax.validation.constraints.Pattern;%0A
 impo
@@ -155,16 +155,16 @@
 ntType;%0A
+
 import j
@@ -457,619 +457,21 @@
 E)%0A@
-NotEmpty(message = %22Key cannot be empty%22)%0A@Pattern(regexp = %22%5E(%5Ba-z0-9%5D(%5B-a-z0-9%5D*%5Ba-z0-9%5D)?(%5C%5C.%5Ba-z0-9%5D(%5B-a-z0-9%5D*%5Ba-z0-9%5D)?)*/)?%5B%5E/%5D*$%22,%0A        message = %22Key name should be an optional lowercase domain name with path%22)%0A@Pattern(regexp = %22%5E(%5B-.a-z0-9%5D%7B0,253%7D/)?%5B%5E/%5D*$%22,%0A        message = %22Key prefix cannot be more than 253 characters.%22)%0A@Pattern(regexp = %22%5E(%5B-.a-z0-9%5D+/)?%5B%5E/%5D%7B0,63%7D$%22,%0A        message = %22Key name cannot be more than 63 characters.%22)%0A@Pattern(regexp = %22%5E(%5B%5E/%5D+/)?%5Ba-zA-Z0-9%5D(%5Ba-zA-Z0-9_.-%5D*%5Ba-zA-Z0-9%5D)?$%22,%0A        message = %22Key name should start with letter or digit and end with letter%22)
+AnnotationKey
 %0A@Co

Reduce the amount of lines