@Override public BooleanExpr toBooleanExpr(JuniperConfiguration jc, Configuration c, Warnings warnings) { return new MatchTag(IntComparator.EQ, new LiteralInt(_tag)); } }
@Override public BooleanExpr toBooleanExpr(JuniperConfiguration jc, Configuration c, Warnings warnings) { return new MatchLocalPreference(IntComparator.EQ, new LiteralInt(_localPreference)); } }
@Override public BooleanExpr toBooleanExpr(JuniperConfiguration jc, Configuration c, Warnings warnings) { return new MatchMetric(IntComparator.EQ, new LiteralInt(_metric)); } }
@Override public void applyTo( List<Statement> statements, JuniperConfiguration juniperVendorConfiguration, Configuration c, Warnings warnings) { statements.add(new SetAdministrativeCost(new LiteralInt(_preference))); }
@JsonCreator private static LiteralInt jsonCreator(@Nullable @JsonProperty(PROP_VALUE) Integer value) { checkArgument(value != null, "%s must be provided", PROP_VALUE); return new LiteralInt(value); }
@Override public BooleanExpr toBooleanExpr(Configuration c, CiscoConfiguration cc, Warnings w) { Disjunction d = new Disjunction(); List<BooleanExpr> disjuncts = d.getDisjuncts(); for (int tag : _tags) { disjuncts.add(new MatchTag(IntComparator.EQ, new LiteralInt(tag))); } return d.simplify(); } }
@Override public BooleanExpr toBooleanExpr(CiscoConfiguration cc, Configuration c, Warnings w) { PrefixSetExpr prefixSetExpr = _prefixSet.toPrefixSetExpr(cc, c, w); if (prefixSetExpr != null) { return new MatchPrefixSet( new IpPrefix(NextHopIp.instance(), new LiteralInt(Prefix.MAX_PREFIX_LENGTH)), prefixSetExpr); } else { Prefix6SetExpr prefix6SetExpr = _prefixSet.toPrefix6SetExpr(cc, c, w); return new MatchPrefix6Set( new Ip6Prefix(new NextHopIp6(), new LiteralInt(Prefix6.MAX_PREFIX_LENGTH)), prefix6SetExpr); } } }
private IntExpr toTagIntExpr(Int_exprContext ctx) { if (ctx.DEC() != null && ctx.DASH() == null && ctx.PLUS() == null) { int val = toInteger(ctx.DEC()); return new LiteralInt(val); } else if (ctx.RP_VARIABLE() != null) { String var = ctx.RP_VARIABLE().getText(); return new VarInt(var); } else { throw convError(IntExpr.class, ctx); } }
private IntExpr toIntExpr(Int_exprContext ctx) { if (ctx.DEC() != null && ctx.PLUS() == null && ctx.DASH() == null) { int val = toInteger(ctx.DEC()); return new LiteralInt(val); } else if (ctx.RP_VARIABLE() != null) { return new VarInt(ctx.RP_VARIABLE().getText()); } else { throw convError(IntExpr.class, ctx); } }
private IntExpr toCommonIntExpr(Int_exprContext ctx) { if (ctx.DEC() != null && ctx.PLUS() == null && ctx.DASH() == null) { int val = toInteger(ctx.DEC()); return new LiteralInt(val); } else if (ctx.RP_VARIABLE() != null) { return new VarInt(ctx.RP_VARIABLE().getText()); } else { /* * Unsupported static integer expression - do not add cases unless you * know what you are doing */ throw convError(IntExpr.class, ctx); } }