/** * Parse the string representation of a refresh policy, usually from a request parameter. */ public static RefreshPolicy parse(String value) { for (RefreshPolicy policy : values()) { if (policy.getValue().equals(value)) { return policy; } } if ("".equals(value)) { // Empty string is IMMEDIATE because that makes "POST /test/test/1?refresh" perform // a refresh which reads well and is what folks are used to. return IMMEDIATE; } throw new IllegalArgumentException("Unknown value for refresh: [" + value + "]."); }
/** * Parse the string representation of a refresh policy, usually from a request parameter. */ public static RefreshPolicy parse(String value) { for (RefreshPolicy policy : values()) { if (policy.getValue().equals(value)) { return policy; } } if ("".equals(value)) { // Empty string is IMMEDIATE because that makes "POST /test/test/1?refresh" perform // a refresh which reads well and is what folks are used to. return IMMEDIATE; } throw new IllegalArgumentException("Unknown value for refresh: [" + value + "]."); }
/** * Parse the string representation of a refresh policy, usually from a request parameter. */ public static RefreshPolicy parse(String value) { for (RefreshPolicy policy : values()) { if (policy.getValue().equals(value)) { return policy; } } if ("".equals(value)) { // Empty string is IMMEDIATE because that makes "POST /test/test/1?refresh" perform // a refresh which reads well and is what folks are used to. return IMMEDIATE; } throw new IllegalArgumentException("Unknown value for refresh: [" + value + "]."); }
/** * Parse the string representation of a refresh policy, usually from a request parameter. */ public static RefreshPolicy parse(String value) { for (RefreshPolicy policy : values()) { if (policy.getValue().equals(value)) { return policy; } } if ("".equals(value)) { // Empty string is IMMEDIATE because that makes "POST /test/test/1?refresh" perform // a refresh which reads well and is what folks are used to. return IMMEDIATE; } throw new IllegalArgumentException("Unknown value for refresh: [" + value + "]."); }
Params withRefreshPolicy(RefreshPolicy refreshPolicy) { if (refreshPolicy != RefreshPolicy.NONE) { return putParam("refresh", refreshPolicy.getValue()); } return this; }
/** * @deprecated If creating a new HLRC ReST API call, use {@link RefreshPolicy} * instead of {@link WriteRequest.RefreshPolicy} from the server project */ @Deprecated Params withRefreshPolicy(WriteRequest.RefreshPolicy refreshPolicy) { if (refreshPolicy != WriteRequest.RefreshPolicy.NONE) { return putParam("refresh", refreshPolicy.getValue()); } return this; }
Params withRefreshPolicy(WriteRequest.RefreshPolicy refreshPolicy) { if (refreshPolicy != WriteRequest.RefreshPolicy.NONE) { return putParam("refresh", refreshPolicy.getValue()); } return this; }
Params withRefreshPolicy(RefreshPolicy refreshPolicy) { if (refreshPolicy != RefreshPolicy.NONE) { return putParam("refresh", refreshPolicy.getValue()); } return this; }