/** * <p> * <code>COUNT</code> overrides the action specified by the individual rule within a <code>RuleGroup</code> . If set * to <code>NONE</code>, the rule's action will take place. * </p> * * @param type * <code>COUNT</code> overrides the action specified by the individual rule within a <code>RuleGroup</code> . * If set to <code>NONE</code>, the rule's action will take place. * @return Returns a reference to this object so that method calls can be chained together. * @see WafOverrideActionType */ public WafOverrideAction withType(String type) { setType(type); return this; }
public WafOverrideAction unmarshall(JsonUnmarshallerContext context) throws Exception { WafOverrideAction wafOverrideAction = new WafOverrideAction(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Type", targetDepth)) { context.nextToken(); wafOverrideAction.setType(context.getUnmarshaller(String.class).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return wafOverrideAction; }
public WafOverrideAction unmarshall(JsonUnmarshallerContext context) throws Exception { WafOverrideAction wafOverrideAction = new WafOverrideAction(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Type", targetDepth)) { context.nextToken(); wafOverrideAction.setType(context.getUnmarshaller(String.class).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return wafOverrideAction; }