All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cloudbees.groovy.cps.impl.BreakBlock Maven / Gradle / Ivy

There is a newer version: 1.31
Show newest version
package com.cloudbees.groovy.cps.impl;

import com.cloudbees.groovy.cps.Block;
import com.cloudbees.groovy.cps.Continuation;
import com.cloudbees.groovy.cps.Env;
import com.cloudbees.groovy.cps.Next;

/**
 * "break" statement to exit a loop.
 *
 * @author Kohsuke Kawaguchi
 */
public class BreakBlock implements Block {
    private final String label;

    public BreakBlock(String label) {
        this.label = label;
    }

    public Next eval(Env e, Continuation k) {
        return e.getBreakAddress(label).receive(null);
    }

    public static final BreakBlock INSTANCE = new BreakBlock(null);

    private static final long serialVersionUID = 1L;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy