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

jaskell.parsec.common.Atom Maven / Gradle / Ivy

Go to download

This is a utils library for java 8 project. It include parsec combinators and sql generators library.

There is a newer version: 2.9.2
Show newest version
package jaskell.parsec.common;

import java.util.Set;
import java.util.function.Predicate;

/**
 * Created by march on 16/9/12.
 * static util class for atom parsers.
 */
public class Atom {
    public static  One one()  {
        return new One<>();
    }

    public static  Eof eof() {
        return new Eof<>();
    }

    public static  Return pack(T value) {
        return new Return<>(value);
    }

    public static  Fail
    fail(String message, Object...objects) {
        return new Fail<>(message, objects);
    }

    public static  Eq eq(E item) {
        return new Eq<>(item);
    }

    public static  Ne ne(E item) {
        return new Ne<>(item);
    }

    public static  OneOf oneOf(Set data) {
        return new OneOf<>(data);
    }

    public static  NoneOf noneOf(Set data) {
        return new NoneOf<>(data);
    }

    public static  Is is(Predicate predicate) {
        return new Is<>(predicate);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy