package java

const fileTpl = `// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: {{ .File.InputPath }}

package {{ javaPackage .File }};

{{ if isOfFileType . }}
@SuppressWarnings("all")
public class {{ classNameFile . }}Validator {
	public static io.envoyproxy.pgv.ValidatorImpl validatorFor(Class clazz) {
		{{ range .AllMessages }}
		{{ if not (ignored .) -}}
		if (clazz.equals({{ qualifiedName . }}.class)) return new {{ simpleName .}}Validator();
		{{- end }}
		{{- end }}
		return null;
	}

{{ range .AllMessages -}}
	{{- template "msg" . -}}
{{- end }}
}
{{ else }}
/**
* Validates {@code {{ simpleName . }}} protobuf objects.
*/
@SuppressWarnings("all")
public class {{ classNameMessage .}}Validator implements io.envoyproxy.pgv.ValidatorImpl<{{ qualifiedName . }}>{
	public static io.envoyproxy.pgv.ValidatorImpl validatorFor(Class clazz) {
		if (clazz.equals({{ qualifiedName . }}.class)) return new {{ simpleName .}}Validator();
		{{ range .AllMessages }}
		{{ if not (ignored .) -}}
		if (clazz.equals({{ qualifiedName . }}.class)) return new {{ simpleName .}}Validator();
		{{- end }}
		{{- end }}
		return null;
	}
	{{- template "msgInner" . -}}
	{{ range .AllMessages -}}
	{{- template "msg" . -}}
	{{- end }}
}
{{ end }}
`
