package ru.r2cloud.util;

import ru.r2cloud.metrics.Status;

import com.codahale.metrics.health.HealthCheck.Result;
import com.codahale.metrics.health.HealthCheck.ResultBuilder;

public final class ResultUtil {

	public static Result unhealthy(String message) {
		ResultBuilder builder = Result.builder();
		builder.unhealthy().withMessage(message).withDetail("status", Status.ERROR);
		return builder.build();
	}
	
	public static Result healthy() {
		ResultBuilder builder = Result.builder();
		builder.healthy().withDetail("status", Status.SUCCESS);
		return builder.build();
	}
	
	public static Result unknown() {
		ResultBuilder builder = Result.builder();
		builder.healthy().withDetail("status", Status.UNKNOWN);
		return builder.build();
	}

	private ResultUtil() {
		//do nothing
	}
}

@@ -205,16 +205,69 @@
 Util %7B%0A%0A
+%09private static final String FIELD_NAME = %22status%22;%0A%0A
 %09public 
@@ -402,32 +402,34 @@
 .withDetail(
-%22status%22
+FIELD_NAME
 , Status.ERR
@@ -569,32 +569,34 @@
 .withDetail(
-%22status%22
+FIELD_NAME
 , Status.SUC
@@ -742,24 +742,26 @@
 hDetail(
-%22status%22
+FIELD_NAME
 , Status

fix code smells