@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"); } }
ttl(ttlOptional); Optional<String> httpOptional = instance.getHttp(); if (httpOptional.isPresent()) { http(httpOptional);