/** * 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 + "]."); }
public static RefreshPolicy readFrom(StreamInput in) throws IOException { return RefreshPolicy.values()[in.readByte()]; }
public static RefreshPolicy readFrom(StreamInput in) throws IOException { return RefreshPolicy.values()[in.readByte()]; }
public static RefreshPolicy readFrom(StreamInput in) throws IOException { return RefreshPolicy.values()[in.readByte()]; }
public static RefreshPolicy readFrom(StreamInput in) throws IOException { return RefreshPolicy.values()[in.readByte()]; }