@Value.Check protected void validate() { checkState(getHttp().isPresent() || getTtl().isPresent() || getArgs().isPresent() || getTcp().isPresent() || getGrpc().isPresent(), "Check must specify either http, tcp, ttl, grpc or args"); if (getHttp().isPresent() || getArgs().isPresent() || getTcp().isPresent() || getGrpc().isPresent()) { checkState(getInterval().isPresent(), "Interval must be set if check type is http, tcp, grpc or args"); } }
http(httpOptional); Optional<String> tcpOptional = instance.getTcp(); if (tcpOptional.isPresent()) { tcp(tcpOptional);