@Override public ScheduleBuilder waitUntilMet() { // user will only be able to call waitUntilMet right after they add a Constraint constraints.get(constraints.size() - 1).setWaitUntilMet(true); return this; }
@Override public ProtoConstraint deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if (json == null) { return null; } if (!(json instanceof JsonObject)) { throw new JsonParseException("Expected a JsonObject but found a " + json.getClass().getName()); } JsonObject object = (JsonObject) json; JsonElement typeJson = object.get("type"); ProtoConstraint.Type constraintType = context.deserialize(typeJson, ProtoConstraint.Type.class); Class<? extends ProtoConstraint> subClass = typeClassMap.get(constraintType); if (subClass == null) { throw new JsonParseException("Unable to map constraint type " + constraintType + " to a run constraint class"); } ProtoConstraint constraint = context.deserialize(json, subClass); constraint.validate(); return constraint; } }
@Override public ProtoConstraint deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if (json == null) { return null; } if (!(json instanceof JsonObject)) { throw new JsonParseException("Expected a JsonObject but found a " + json.getClass().getName()); } JsonObject object = (JsonObject) json; JsonElement typeJson = object.get("type"); ProtoConstraint.Type constraintType = context.deserialize(typeJson, ProtoConstraint.Type.class); Class<? extends ProtoConstraint> subClass = typeClassMap.get(constraintType); if (subClass == null) { throw new JsonParseException("Unable to map constraint type " + constraintType + " to a run constraint class"); } ProtoConstraint constraint = context.deserialize(json, subClass); constraint.validate(); return constraint; } }
@Override public ScheduleBuilder waitUntilMet() { // user will only be able to call waitUntilMet right after they add a Constraint constraints.get(constraints.size() - 1).setWaitUntilMet(true); return this; }
@Override public ScheduleBuilder abortIfNotMet() { // user will only be able to call abortIfNotMet right after they add a Constraint constraints.get(constraints.size() - 1).setWaitUntilMet(false); return this; }
@Override public ScheduleBuilder abortIfNotMet() { // user will only be able to call abortIfNotMet right after they add a Constraint constraints.get(constraints.size() - 1).setWaitUntilMet(false); return this; }
@Override public void setWaitUntilMet(boolean waitUntilMet) { super.setWaitUntilMet(waitUntilMet); validate(); }
@Override public void setWaitUntilMet(boolean waitUntilMet) { super.setWaitUntilMet(waitUntilMet); validate(); }